K
K
ksim_miloff2017-03-01 11:51:02
proxy
ksim_miloff, 2017-03-01 11:51:02

How to set up transparent proxy for docker containers?

Hello everyone,
There is a big project based on microservices that run in docker containers. There is also a bashscript that raises a project for the dev environment, which, incl. download and install docker images. The main team that created the project works separately, in another country with different conditions and they don't have a proxy, but I do. Proxies are the main problem. At first the images didn't download (even hello-world), then I did as it says here . This is an instruction for setting up a proxy for the host machine and it helped to download images, as for containers, everything is bad there. Applications in containers try to access the Internet for various internal affairs and cannot.
Googled a lot, the only thing I found was to use something like:
docker build --build-arg HTTP_PROXY=http://...
But the main development team is against this approach, because. there are variations at the code level, which forces us to store two types of configs: for their team and for mine, which is not correct. I agree with them that the problem needs to be solved somehow differently, at the level of my PC or at the level of the enterprise network.
A little more googling led to two interesting publications: one , two . As I understand it, both authors solved their problems, but, unfortunately, I don’t have enough knowledge to understand what is happening, I’m not even a middle developer yet. The guys from the main team cannot help either, and all this fell on me.
Does anyone have experience in solving a similar problem? I really need help.
Thank you for your attention.
PS: OS Ubuntu 16
UPD: After many hours of searching, I found docker-proxy , which was advised in several different topics at once. If I understand the idea correctly, then an additional container is launched here, which translates all internal http requests from other docker containers to itself, and then to a proxy. But nothing worked for me.
UPD: Accidentally started building a project with openvpn running and saw that docker-proxy is trying to be a conductor for other containers, but because of openvpn it is looking for external links on the wrong network. In short, it doesn't work again. but this suggests that in the previous UPD, I just configured something wrong.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question