Run Omnigent with Docker Compose
The omnigent service runs Omnigent on the directory in
WORKSPACE. compose.sh checks that WORKSPACE is an absolute path,
because Compose would resolve a relative one against this directory, then runs
docker compose here.
- Images
- GHCR
ghcr.io/hambn/omnigent - Docker Hub
docker.io/hambn/omnigent
- GHCR
- Use case
- Repeatable local orchestration sessions
On this page
Prerequisites
- Docker Engine with the Compose v2 plugin.
- A model credential, such as
ANTHROPIC_API_KEYorOPENAI_API_KEY.
Run Omnigent
The Compose files pass no environment. Forward your key with -e:
export ANTHROPIC_API_KEY=sk-ant-...
WORKSPACE="$PWD" ./compose.sh run --rm -e ANTHROPIC_API_KEY omnigentArguments after the service name go to omnigent, for example omnigent codex.
Omnigent's settings in /home/sysadmin/.omnigent are removed with the container, and
its web UI on port 6767 is not published.
Run without registry access
On a connected machine, run docker save ghcr.io/hambn/omnigent:ubuntu-browser -o omnigent.tar.
On the offline host, load it and use the air-gapped file, which sets
pull_policy: never:
docker load -i omnigent.tar
WORKSPACE="$PWD" ./compose.sh -f airgapped.docker-compose.yml run --rm \
-e ANTHROPIC_API_KEY omnigentVariables
| Variable | Required | Purpose |
|---|---|---|
WORKSPACE |
yes | Absolute host path mounted at /workspace. |
OMNIGENT_IMAGE |
no | Image for both Compose files. Defaults to ghcr.io/hambn/omnigent:ubuntu-browser; set a digest reference to pin one build. |
Workspace
WORKSPACE is mounted at /workspace. Omnigent runs as UID 1000, so new files belong
to UID 1000 on the host.
Files
compose.shvalidatesWORKSPACEand passes its arguments todocker compose.docker-compose.ymlruns the published image.airgapped.docker-compose.ymlruns a loaded image and never pulls.
File contents
airgapped.docker-compose.yml12 lines
# Offline: docker load -i omnigent.tar first, then
# WORKSPACE="$PWD" ./compose.sh -f airgapped.docker-compose.yml run --rm omnigent
name: omnigent
services:
omnigent:
image: ${OMNIGENT_IMAGE:-ghcr.io/hambn/omnigent:ubuntu-browser}
pull_policy: never
volumes:
- ${WORKSPACE:?Set WORKSPACE to an absolute host path}:/workspace
stdin_open: true
tty: truecompose.sh18 lines
#!/usr/bin/env bash
# Compose resolves relative paths against this directory, so require an absolute WORKSPACE.
set -euo pipefail
case "${WORKSPACE:-}" in
/*) ;;
"")
echo "Set WORKSPACE to an absolute host path." >&2
exit 2
;;
*)
echo "WORKSPACE must be an absolute host path: $WORKSPACE" >&2
exit 2
;;
esac
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
exec docker compose "$@"docker-compose.yml10 lines
# WORKSPACE="$PWD" ./compose.sh run --rm omnigent
name: omnigent
services:
omnigent:
image: ${OMNIGENT_IMAGE:-ghcr.io/hambn/omnigent:ubuntu-browser}
volumes:
- ${WORKSPACE:?Set WORKSPACE to an absolute host path}:/workspace
stdin_open: true
tty: true