Run agentbloat with Docker
run.sh opens a Zsh login shell in agentbloat with the
current directory mounted at /workspace. airgapped.run.sh
does the same from a saved image on a host that cannot pull.
- Images
- GHCR
ghcr.io/hambn/agentbloat - Docker Hub
docker.io/hambn/agentbloat
- GHCR
- Use case
- Interactive multi-agent workspace
On this page
Prerequisites
- Docker Engine 23 or later.
Open a shell
./run.sh
cd /workspaceThe shell starts in /home/sysadmin. Run any agent, for example claude or codex,
and sign in from its prompt. Logins are saved in the home directory and removed with
the container when you exit. To pass an API key instead, add -e OPENAI_API_KEY or
another variable to the docker run line in run.sh.
To let agents run Docker commands, set AGENTBLOAT_DOCKER_SOCKET to the host socket.
run.sh mounts it at /var/run/docker.sock and adds its group:
AGENTBLOAT_DOCKER_SOCKET=/var/run/docker.sock ./run.shAccess to the socket gives the container root on the host.
Run without registry access
On a machine that can pull, save the image:
docker save ghcr.io/hambn/agentbloat:ubuntu-browser -o agentbloat.tarCopy the tar to the offline host and pass its path first; any remaining arguments replace the shell command:
./airgapped.run.sh agentbloat.tarThe script loads the tar and runs AGENTBLOAT_IMAGE with --pull=never. The agents
still need network access to their model providers.
Variables
| Variable | Required | Purpose |
|---|---|---|
AGENTBLOAT_IMAGE |
no | Image both scripts run. Defaults to ghcr.io/hambn/agentbloat:ubuntu-browser; set ghcr.io/hambn/agentbloat@sha256:<digest> to pin one build. |
AGENTBLOAT_DOCKER_SOCKET |
no | Host Docker socket for run.sh to mount at /var/run/docker.sock. |
Workspace
The current directory is mounted at /workspace. The agents run as sysadmin
(UID 1000), so new files belong to UID 1000 on the host.
Files
run.shpulls the image if needed and opens the shell.airgapped.run.shloads a saved tar and runs it without pulling.
File contents
airgapped.run.sh17 lines
#!/usr/bin/env bash
# Offline host: load the image from a tar saved on an online host, never pull.
# docker save ghcr.io/hambn/agentbloat:ubuntu-browser -o agentbloat.tar
set -euo pipefail
image=${AGENTBLOAT_IMAGE:-ghcr.io/hambn/agentbloat:ubuntu-browser}
tar=${1:-agentbloat.tar}
shift $(($# > 0 ? 1 : 0))
[[ -f "$tar" ]] || {
echo "missing $tar; docker save it on an online host first" >&2
exit 1
}
docker load -i "$tar"
docker run -it --rm --pull=never \
-v "$PWD:/workspace" \
"$image" "$@"run.sh21 lines
#!/usr/bin/env bash
# Run an interactive agentbloat shell against the current directory.
set -euo pipefail
image=${AGENTBLOAT_IMAGE:-ghcr.io/hambn/agentbloat:ubuntu-browser}
docker_options=()
if [[ -n "${AGENTBLOAT_DOCKER_SOCKET:-}" ]]; then
[[ -S "$AGENTBLOAT_DOCKER_SOCKET" ]] || {
echo "not a Docker socket: $AGENTBLOAT_DOCKER_SOCKET" >&2
exit 1
}
docker_options+=(
--volume "$AGENTBLOAT_DOCKER_SOCKET:/var/run/docker.sock"
--group-add "$(stat -c %g "$AGENTBLOAT_DOCKER_SOCKET")"
)
fi
docker run -it --rm \
"${docker_options[@]}" \
-v "$PWD:/workspace" \
"$image" "$@"