Docker Community Forums

Share and learn in the Docker community.

Need to specify proxy settings

I also need to work through proxy so +1 here.

I also need this feature. In the Version 1.11.1-beta10 (build: 6662), the following environment variables are just ignored.
http_proxy
FTP_PROXY
ftp_proxy
ALL_PROXY
all_proxy
HTTPS_PROXY
https_proxy
no_proxy
HTTP_PROXY

I am always thinking it would be great if the docker client could forward some env to the docker engine, or add some docker pull flag like -proxy=http://xxxxxx:xx.

1 Like

A workaround would be great till we have the official http proxy support.

It doesn’t work. I could modify it but whenever you restart Docker for Mac, the change is lost.

+1 and yeah would also love to have a work around on this in the meantime. Has anyone found a way to make this work?

+1 Also need to be able to specify HTTPS proxy in order to reach out for the internet.

Yeah, another +1 for me, though I am surprised about the expectation of making things work for VPNs and leaving out proxies since they are pretty much always stuck together

+1 - have to use the toolbox at work until I’m able to specify the proxy settings… :frowning:

+1 need it as well, as this is a deal breaker

+1 this feature is urgently needed

an additional +1 for this feature from me

+1 support for this is needed.

+1 support for this is needed.

+1 for me too, all main companies used to work behind a proxy. :grin:

I used to be able to set the proxy for Docker beta for mac using the following script.

function dockerproxyon {
  screen -L -dmS docker ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
  screen -p 0 -X stuff $(echo -ne '\015')$(echo -ne '\015')$(echo -ne '\015')
  sleep 1
  echo "logging in"
  screen -S docker -p 0 -X stuff root
  screen -S docker -p 0 -X stuff $(echo -ne '\015')
  sleep 2
  echo "stripping old proxy config"
  screen -S docker -p 0 -X stuff "sed -i -E '/_proxy/d' /etc/init.d/docker"$(echo -ne '\015')
  sleep 1
  echo "Setting proxy in docker."
  screen -S docker -p 0 -X stuff "sed -i -E '/Starting Docker/ a export no_proxy=*internal.net' /etc/init.d/docker"$(echo -ne '\015')
  screen -S docker -p 0 -X stuff "sed -i -E '/Starting Docker/ a export https_proxy=http://myproxy:3128' /etc/init.d/docker"$(echo -ne '\015')
  screen -S docker -p 0 -X stuff "sed -i -E '/Starting Docker/ a export http_proxy=http://myproxy:3128' /etc/init.d/docker"$(echo -ne '\015')
  
  echo "restarting docker service"
  screen -S docker -p 0 -X stuff "service docker restart"$(echo -ne '\015')
  screen -S docker -p 0 -X stuff "service docker restart"$(echo -ne '\015')
  screen -S docker -p 0 -X stuff "exit"$(echo -ne '\015')
  screen -S docker -X stuff quit
}

but now i can not restart the docker service in verion Version 1.11.1-beta12 (build: 7528)
4151b0fc71e51fb8e551d0a1870893ac99a379bc

Rolling back to Version 1.11.1-beta11 (build: 6974)
37559e5f6acd56a4810963acc7001e88f2d88017 fixed my issue.

+1 unfortunately beta is unusable til this is available. can’t seem to get any of the workarounds working either.

Good news! We now have support for reading HTTP Proxy settings from OSX.
Please update to Beta 13 and let us know how you get on!

2 Likes

@davetucker might be useful if the Settings in GUI has some kind of hint that it uses the System Preferences config for proxy (https://beta.docker.com/docs/mac/networking/).