| name | using-docker-in-web |
| description | Set up and use Docker in Claude Code for Web environments. Use when Docker builds fail with bridge/iptables errors, SSL certificate errors through proxy, or when working in containerized web environments. |
| paths | ["**/Dockerfile*","**/docker-compose*.yml","**/docker-compose*.yaml","**/.dockerignore"] |
Docker in Claude Code for Web
Claude Code for Web runs in a restricted container environment that requires special configuration for Docker.
Detection
You're in Claude Code for Web if:
echo $http_proxy
test -f /.dockerenv && echo "In container"
iptables -L 2>&1 | grep -q "Permission denied"
Quick Setup
sudo apt-get update && sudo apt-get install -y docker.io
sudo dockerd --iptables=false --bridge=none &
sleep 3
docker info
Building csb Images
Standard builds fail because Docker tries to create bridge networks. Use these flags:
csb build --host-network --insecure
What these flags do:
--host-network: Uses host networking instead of bridge (which requires iptables)
--insecure: Adds -k to curl commands and disables npm strict-ssl (for SSL-intercepting proxies)
Creating Sandboxes
Sandbox creation also needs host networking:
csb create my-sandbox --egress=all
Common Errors and Fixes
"iptables: Permission denied"
The daemon is trying to manage iptables rules. Restart with:
sudo pkill dockerd
sudo dockerd --iptables=false --bridge=none &
"network bridge not found"
Same issue - daemon needs --bridge=none flag.
"SSL certificate problem"
The proxy intercepts HTTPS. Use --insecure flag with csb build, or for manual curl:
curl -k https://example.com
"npm ERR! unable to verify certificate"
npm config set strict-ssl false
npm install
npm config set strict-ssl true
Full Workflow Example
sudo apt-get update && sudo apt-get install -y docker.io
sudo dockerd --iptables=false --bridge=none &
sleep 3
csb build --host-network --insecure
csb create dev --egress=all
csb ssh dev
Limitations
In Claude Code for Web:
- No bridge networking - containers share host network
- No egress proxy container (requires iptables)
- SSL verification must be disabled for builds
- GPU passthrough not available
Cleanup
docker stop $(docker ps -q) 2>/dev/null
sudo pkill dockerd