fix: correct command for running a container from image

This commit is contained in:
phoenix 2025-04-17 06:41:56 +01:00
parent e380058907
commit dfca4782bf

View File

@ -12,11 +12,13 @@ start_container_if_needed() {
if ! podman container exists "$CONTAINER"; then
echo "🚀 Creating container $CONTAINER..."
podman run -dit \
--userns=keep-id \
--name "$CONTAINER" \
--user "$DEV_USER" \
--hostname devbox \
--hostname "$CONTAINER" \
--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
echo "⚡ Starting existing container $CONTAINER..."
podman start "$CONTAINER"