docker-machine behind corporate proxy

eighilaza picture eighilaza · Jul 2, 2015 · Viewed 25.2k times · Source

I am trying to use docker-machine to create an instance on a private cloud (Openstack) that is behind a corporate http proxy.

Is it possible to tell docker-machine to use the proxy or do I need to have a glance image that is already pre-configure with the http_proxy env variable?

Answer

Senri picture Senri · Sep 27, 2016

As previously mentioned, you can edit the file at

$HOME\.docker\machine\machines\default\config.json

and set the HTTP_PROXY, HTTPS_PROXY and NO_PROXY variables (or delete them):

 "HostOptions": {
        "Driver": "",
        ...
        "EngineOptions": {
           ...
            "Env": [
              "HTTP_PROXY=http://10.121.8.110:8080",
              "HTTPS_PROXY=http://10.121.8.110:8080",
              "NO_PROXY=192.168.23.4"
            ],

After the file has edited, you only have to execute:

docker-machine provision