Docker Desktop VM no internet access from the corporate network

Viewed 737
2 Answers

Docker Desktop lets you configure HTTP/HTTPS Proxy Settings and automatically propagates these to Docker. For example, if you set your proxy settings to http://proxy.example.com Docker uses this proxy when pulling containers.

Your proxy settings, however, will not be propagated into the containers you start. If you wish to set the proxy settings for your containers, you need to define environment variables for them, just like you would do on Linux, for example:

> docker run -e HTTP_PROXY=https://proxy.example.com:3128 alpine env

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b7edf988b2b5
TERM=xterm
HOME=/root
HTTP_PROXY=http://proxy.example.com:3128

For more information on setting environment variables for running containers, Set environment variables

I use px proxy (https://github.com/genotrance/px) and configure docker proxy to use it running on my machine (in my case http://127.0.0.1:3131/).

Then docker login, on the command line, works as well as pull and push requests.

Docker "sign in" in the graphical interface always returns "unknown error". Using the command line everything else works fine.

Related