Skip to content

Instantly share code, notes, and snippets.

@innyso
Last active April 12, 2020 11:16
Show Gist options
  • Save innyso/b85cccfbbe5110910c49ea83cbae5419 to your computer and use it in GitHub Desktop.
Save innyso/b85cccfbbe5110910c49ea83cbae5419 to your computer and use it in GitHub Desktop.
#docker #macos #proxy

using docker for mac behind cooperate proxy

Assuming that you are behind a cooperate proxy and running cntlm or squid to proxy all your outgoing traffic to the interweb.

When using docker for Mac, becuase docker for mac provision a xhyve VM under the hood, so having set the docker preference proxy setting to http[s]://localhost:3128 is not going to help as localhost == xhyve VM not the Mac.

Logging into the xhyve VM

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

and run ifconfig, observe eth0 which is the network connecting to the host and it just happen that the X.X.X.1 is the host ip address.

e.g. 192.168.65.2 is the eth0 address therefore 192.168.65.1 is the host ip from the xhyve VM

Set the http and https proxy in docker preference!!!

reference: https://forums.docker.com/t/beta-13-didnt-work-with-local-proxy/13569/12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment