0

I've gone through the various questions here and I can't seem to get this working.

I have a ubuntu server running docker. I have laradock which has a lot of options on running a web server, sql server, php, etc.

This ubuntu server is behind a corporate network.

The nginx, php-fpm and mysql containers are hosting a laravel app.

When the nginx docker container needs to access the internet, I need it to go through the corporate proxy server.

Can someone please point me in the right direction where to configure this? On the Docker Host, on the Containers themselves, on all the containers?

Thanks!

PiotrG
  • 743
  • 6
  • 24

1 Answers1

0

See https://docs.docker.com/network/proxy/, section Configure the Docker client.

Note: You will need to restart your containers after updating the ~/.docker/config.json file.

gkivanov
  • 223
  • 1
  • 11
  • I've already done this and if I control my proxy server logs, I see that docker pulls the images it needs from the internet when building a container over the proxy. BUT when I then start the nginx container and in a very simple html website add a IMG link to an internet site with an image, it does not go over the proxy. – PiotrG Jan 11 '19 at 10:20
  • Does doing `curl -L https://google.com` from inside the container work correctly? – gkivanov Jan 11 '19 at 10:27
  • unfortunately no curl in this container, but I set up a quick ubuntu simple container (also hopefully inheriting the proxy from config.json) and did a curl and I get a result. However proxy server logs show nothing. it's like that config.json setting works for when building the image but it not passed to the containers. I do have v18 so according to the docker docs i can use the config.json. – PiotrG Jan 11 '19 at 10:33