Redsocks Docker image
This docker image allows you to use docker on a host without being bored by your corporate proxy.
You have just to run this container and all your other containers will be able to access directly to internet (without any proxy configuration).
Start the container like this:
docker run --privileged=true --net=host -d ncarlier/redsocks 22.214.171.124 3128
Replace the IP and the port by those of your proxy.
The container will start redsocks and automatically configure iptable to forward all the TCP traffic through the proxy.
If you want to add exception for an IP or a range of IP you can edit the whitelist file.
Once edited you can replace this file into the container by mounting it:
docker run --privileged=true --net=host \ -v whitelist.txt:/etc/redsocks-whitelist.txt \ -d ncarlier/redsocks 126.96.36.199 3128
Use docker stop to halt the container. The iptables rules should be reversed. If not, you can execute this command:
iptables-save | grep -v REDSOCKS | iptables-restore
Build the image with
make helpto see available commands for this image.