#8050: fix: docker hardening
docs
docker
stale
Cluster:
Docker and Deployment Improvements
make docker gateway bind default to loopback, lower container permissions and add cli-only option
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR hardens the Docker Compose deployment by (1) dropping Linux capabilities and enabling `no-new-privileges` for the gateway + CLI containers, (2) changing the gateway bind default in `docker-compose.yml` from `lan` to `loopback`, and (3) adding a `CLI_ONLY` mode that applies a compose override to remove published host ports.
The changes integrate with the existing `docker-setup.sh` flow by adding a new optional compose file (`docker-compose.cli-only.yml`) and persisting `CLI_ONLY` into `.env`, plus a new test that validates the override is included when `CLI_ONLY=true`.
<h3>Confidence Score: 3/5</h3>
- Mostly safe to merge, with a couple of consistency/docs issues worth fixing first.
- The hardening changes are straightforward, but `docker-setup.sh` still defaults `OPENCLAW_GATEWAY_BIND` to `lan`, which will override the new compose default and can unintentionally undo the hardening. Docs also show including optional compose files unconditionally, which can break manual usage when the files aren’t present. No evidence of deeper runtime breakage beyond these items.
- docker-setup.sh (bind default consistency), docs/install/docker.md (manual compose instructions)
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#12504: fix: allow docker cli container to connect to gateway
by bvanderdrift · 2026-02-09
86.5%
#9881: chore(compose): harden gateway (localhost ports, limits, logging, h...
by tiagoderossi · 2026-02-05
85.9%
#9992: Docker: Fixed port mapping so ports publish when not stated
by Lightmean03 · 2026-02-06
85.4%
#9999: Docker: fix token mismatch and add dev setup workflow
by benclarkeio · 2026-02-06
85.1%
#4695: Fixed the default CLI image to use published GHCR image
by TASMAYU · 2026-01-30
84.7%
#9190: feat(docker): Add autonomous container self-restart and runtime pac...
by alexdredmon · 2026-02-05
84.4%
#7342: fix(docker): ensure readability of docker-setup.sh
by esc-ouni · 2026-02-02
84.1%
#13950: fix(docker): add browser sidecar service and health checks
by n24q02m · 2026-02-11
83.9%
#7133: feat: Automated Docker setup with environment-based configuration
by synetalsolutions · 2026-02-02
83.3%
#8710: fix: Docker 安全強化與 Ollama 整合
by bluefishs · 2026-02-04
83.0%