← Back to PRs

#12629: Dockerfile: pre-install common CLI tools for agent runtime

by jhs129 open 2026-02-09 12:07 View on GitHub →
docker stale
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