From dfca4782bf3f586b12c7b9d857f4f6b5e405e3ca Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 17 Apr 2025 06:41:56 +0100 Subject: [PATCH] fix: correct command for running a container from image --- ssh_router.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ssh_router.sh b/ssh_router.sh index 017fc1e..4089213 100644 --- a/ssh_router.sh +++ b/ssh_router.sh @@ -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"