fix: correct command for running a container from image
This commit is contained in:
parent
e380058907
commit
dfca4782bf
@ -12,11 +12,13 @@ start_container_if_needed() {
|
|||||||
if ! podman container exists "$CONTAINER"; then
|
if ! podman container exists "$CONTAINER"; then
|
||||||
echo "🚀 Creating container $CONTAINER..."
|
echo "🚀 Creating container $CONTAINER..."
|
||||||
podman run -dit \
|
podman run -dit \
|
||||||
|
--userns=keep-id \
|
||||||
--name "$CONTAINER" \
|
--name "$CONTAINER" \
|
||||||
--user "$DEV_USER" \
|
--user "$DEV_USER" \
|
||||||
--hostname devbox \
|
--hostname "$CONTAINER" \
|
||||||
--label auto-cleanup=true \
|
--label auto-cleanup=true \
|
||||||
"$IMAGE" bash
|
-v "${XDG_RUNTIME_DIR}"/podman/podman.sock:/run/podman/podman.sock \
|
||||||
|
"$IMAGE" sh -c "tmux has-session -t $TMUX_SESSION 2>/dev/null || tmux new-session -s $TMUX_SESSION"
|
||||||
elif ! podman inspect -f '{{.State.Running}}' "$CONTAINER" | grep -q true; then
|
elif ! podman inspect -f '{{.State.Running}}' "$CONTAINER" | grep -q true; then
|
||||||
echo "⚡ Starting existing container $CONTAINER..."
|
echo "⚡ Starting existing container $CONTAINER..."
|
||||||
podman start "$CONTAINER"
|
podman start "$CONTAINER"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user