sandbox.sh utility to easily log into or execute commands in a sandbox, set hostname and SANDBOX env var to container name (#92)

This commit is contained in:
Olcan
2025-04-21 13:52:51 -07:00
committed by GitHub
parent ddaa21c750
commit 09973956ae
2 changed files with 112 additions and 1 deletions

View File

@@ -41,7 +41,10 @@ INDEX=0
while $CMD ps -a --format "{{.Names}}" | grep -q "$IMAGE-$INDEX"; do
INDEX=$((INDEX + 1))
done
run_args+=(--name "$IMAGE-$INDEX")
run_args+=(--name "$IMAGE-$INDEX" --hostname "$IMAGE-$INDEX")
# also set SANDBOX environment variable as container name
run_args+=(--env "SANDBOX=$IMAGE-$INDEX")
# enable debugging via node --inspect-brk (and $DEBUG_PORT) if DEBUG is set
node_args=()