Monday, 15 February 2010

How can I make all my docker containers use my proxy? -


I'm running a docker on Debian JC which is behind the corporate proxy to be able to download Docker images, I confirm that your / etc / defaults / docker

  http_proxy = "http: // localhost: 3128 /"  

I can do that work.

However, to be able to access the interweb from within your container, I will assign all sessions to - net host and then setup these env variables:

< The host network is not required for the container, and do not want to know about the proxy (i.e. port 20, 80, in the container 443 of the host's proxy port Go through). Is this possible?

If this is unsuccessful, is it possible to set up a site, which will ensure that these envive variables are set locally but are never exported as part of an image? I know that I can pass these things with - env ​​http_proxy = ... etc, but this is clunky I use it for all users on the system without using aliases Want to do

(Disclaimer: I asked this, but the home question for Docker is a bit unclear moment).

see:

The host server is running a container with a proxy (In this case squid, which can do transparent proxying). The container has some IPTable rules that the Net Traffic in the proxy server - this means that the container needs to be run in privileged mode.

Also in the host server (and there is magic) IP route table entries which re-route all traffic from any container but proxy container via proxy proxy for port 80.

This last bit means that for port 80 traffic, from the container to the rest of the world the proxy container - it is giving chance of NAT and transparent proxy.


No comments:

Post a Comment