summaryrefslogtreecommitdiff
path: root/scripts/start_container.sh
blob: dbdd305d14046b345ac14465f314a1f24e8a40c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
set -euo pipefail

IMAGE=gemini-code-sandbox
CLI_DIST=/usr/local/share/npm-global/lib/node_modules/\@gemini-code/cli
WORKDIR=/sandbox/$(basename "$PWD")

# use docker if installed, otherwise try to use podman instead
if command -v docker &> /dev/null; then
    CMD=docker
elif command -v podman &> /dev/null; then
    CMD=podman
else
    echo "ERROR: docker or podman must be installed"
    exit 1
fi

$CMD run -it --rm -v"$PWD:$WORKDIR" --workdir "$WORKDIR" "$IMAGE" node "$CLI_DIST"