#12629: Dockerfile: pre-install common CLI tools for agent runtime
docker
stale
Cluster:
Docker and Deployment Improvements
Hey there! I've been running OpenClaw on Fly.io and found that pre-installing common CLI tools into the Docker image makes a huge difference for the agent experience. Instead of waiting for runtime installs (which are slow and don't persist across restarts), the agent has everything it needs right away.
## Summary
- **System packages**: git, python3, pip, venv, and audio/SSL libraries
- **Go toolchain**: Go 1.25 copied from official image, plus gogcli (GOG Galaxy CLI) built from source
- **Pre-built binaries**: himalaya (email/IMAP), gh (GitHub CLI), slack CLI, sag (ElevenLabs TTS), spotify-player, jira-cli
- **npm globals**: trello-cli, notion-cli, vercel, claude-code, shopify CLI, mcporter
- **Homebrew (Linuxbrew)**: installed as non-root node user so the agent can `brew install` anything else it needs at runtime
- **Persistent /data paths**: `NPM_CONFIG_PREFIX`, `PNPM_HOME`, `GOPATH`, `GOBIN` all point to `/data/` so runtime-installed tools survive container restarts when a persistent volume is mounted
## Why this matters
The agent's bash tools can invoke any of these CLIs directly. Without pre-installation, the agent has to install tools on every container restart, which is slow and fragile. With a persistent volume at `/data`, even runtime installs stick around, but having the common ones baked in means zero cold-start delay.
## Test plan
- [ ] `docker build .` completes successfully
- [ ] All binaries are accessible: `gog`, `himalaya`, `gh`, `slack`, `sag`, `spotify_player`, `jira`
- [ ] npm globals are on PATH: `trello-cli`, `notion`, `vercel`, `claude`, `shopify`
- [ ] `brew --version` works as the node user
- [ ] Go toolchain works: `go version`
- [ ] Gateway starts normally with the new image
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR substantially expands the Docker build to preinstall a Go toolchain, build `gogcli` from source, and download/install multiple third-party CLIs (GitHub, Slack, Jira, Spotify, etc.), plus sets `/data`-backed env vars for persistent runtime tool installs and installs Homebrew as the non-root `node` user.
The main integration point with the repo is the top-level `Dockerfile`, which now becomes responsible for provisioning the agent runtime tooling inside the container image before the existing pnpm build and gateway startup.
<h3>Confidence Score: 2/5</h3>
- This PR is not safe to merge until Docker build-breaking issues are addressed.
- The Dockerfile introduces multiple likely build breakers: it relies on `curl` and `bash` without ensuring they exist, uses `git clone` in a builder stage without installing git, installs `gh` via `dpkg -i` without dependency resolution, and hardcodes amd64 binaries/GOARCH which breaks multi-arch builds.
- Dockerfile
<!-- greptile_other_comments_section -->
<sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#9190: feat(docker): Add autonomous container self-restart and runtime pac...
by alexdredmon · 2026-02-05
83.3%
#7133: feat: Automated Docker setup with environment-based configuration
by synetalsolutions · 2026-02-02
79.5%
#22491: Use multi-stage docker build to reduce image size from 4.72GB -> 2....
by mm-zacharydavison · 2026-02-21
79.5%
#3324: Update Dockerfile to support Homebrew and Go for skill execution
by nnnet · 2026-01-28
79.3%
#23313: feat(docker): add optional build-arg OPENCLAW_INSTALL_DOCKER_CLI to...
by zhuxuwei88-bot · 2026-02-22
78.1%
#6698: feat: Add CLI wrapper for Docker integration and update documentation
by barshopen · 2026-02-01
77.1%
#9999: Docker: fix token mismatch and add dev setup workflow
by benclarkeio · 2026-02-06
76.9%
#5866: feat: add optional Docker official repo APT source
by codearranger · 2026-02-01
76.6%
#17151: fix: add npm link to fix CLI permission denied (exit 127)
by sskyu · 2026-02-15
76.1%
#4695: Fixed the default CLI image to use published GHCR image
by TASMAYU · 2026-01-30
75.9%