Search code examples
dockerdocker-machine

docker-machine behind corporate proxy


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?


Solution

  • 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