← Back to PRs

#8050: fix: docker hardening

by christopherbarnett96 open 2026-02-03 14:23 View on GitHub →
docs docker stale
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