Proxy settings for the Docker daemon

I moved your post from the https://forums.docker.com/t/unable-to-install-git-in-dockerfile topic here. Please don’t start an unrelated question in your previous topics. This way visitors can find the answer quicker in each topic.

Based on your quoted files I suppose you followed the documentation
https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

How and what did you reload? The docs mentions reloading the systemd daemon and also restarting the docker daemon.

Actually one would be enough and even better. Now you have NO_PROXY in two files. It doesn’t make sense you used the same values and the values of the variables wouldn’t be merged anyway.

If it doesn’t work after restarting reloading the systemd daemon and restarting Docker, I would create the systemd config this way:

systemctl edit docker.service

It would create a file called (I think) “ovverride.conf” in the right folder and possibly even reload the systemd daemon… I used the same solution as you, so that should work, however I had problem with an other systemd config when I wanted to use Ubuntu 20.04 after Ubuntu 18.04 and I created the files manually. After using systemctl edit, everything worked. Although I configured a socket and not environment variables.