A docker container to forward traffic to an HTTP proxy relay.
It uses redsocks to forward requests to a proxy. go-any-proxy may be an alternative.
To use docker behind http proxy at work.
- start a docker container with cntlm and redsocks
- set up an iptable rule to redirect everything incoming from network interface docker0 to the proxy-relay-container
Obtain the startup script
wget https://github.com/kops/docker-proxy-relay/raw/master/docker_proxy.sh
chmod +x docker_proxy.sh
Start the proxy relay and redirect all docker containers outgoing traffic on port 80 to the proxy-relay-container
./docker_proxy.sh start <username> <proxy_host>:<proxy_port>
<username> <proxy_host>:<proxy_port> password: xxxxxx
Stop the proxy relay:
./docker_proxy.sh stop
Get status:
./docker_proxy.sh status