Using Docker for Mac Behind the Corporate Proxy

how to use docker for mac when behind a corporate proxy


Although enabling internet access for Docker for Mac when behind a corporate proxy appears to be difficult, the steps required are surprisingly simple.


A local proxy server should be running on the Mac where Docker is running in order to authenticate with the dreaded corporate proxy. Both Charles Proxy and SquidMan work well for this purpose. It is assumed below that the local proxy server is listening on port 8099; feel free to change this value throughout, if required.

Getting the IP Address of the Docker VM Gateway

Connect to the VM, as detailed in Accessing the Docker For Mac Virtual Machine.

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

Press the Enter key, and validate we are on the Docker VM.

/ # hostname

Examine the routing table to see the default gateway: in the example below, this is

/ # netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth0     U         0 0          0 docker0     U         0 0          0 br-b46215017f01 U         0 0          0 eth0

Disconnect from the VM using ctrl a \, answering y to the prompt:

Really quit and kill all your windows [y/n] y

Set the Docker for Mac Proxy

Finally, set the proxy in Docker itself, as shown below:
Docker for Mac Proxy Settings

The IP address is the gateway IP address from the Docker VM (i.e.; the port is what the local proxy is listening on (i.e. 8099). Apply the changes and restart Docker, at which point it will now be able to communicate, via the local proxy server, to the internet. Easy!

2 thoughts on “Using Docker for Mac Behind the Corporate Proxy”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s