Neither the /etc/default/docker file using service docker start nor the service.d drop_in work for getting the daemon to use the proxy server. The only way I could get the docker daemon to use the proxy was to manually launch docker like so
https_proxy=http://domain\user:password@proxy.mycompany.com:80 dockerd
Yep and those instructions are totally ignored by either the systemctl or docker itself. In fact, they are so ignored that the systemctcl command to show properties can’t even find the Environment property. Flat out just doesn’t work.
Me too, I have been using dropin files for more than 3 years and docker versions stretching back that far, and they have worked exactly as documented for all that time on RHEL.
I’m not too worried about it at this point. I just wanted the registry container for a private registry and quite happy if no one can get to the docker.io from that box.
Hi I have the same issues mentioned and the exact same release ( as specified by usb_release -a ). I tried doing the systemctl set-environment . Can you mention the exact command used . I am able to set any variable but I wanted to set it for the service . (docker ).
This appears to still be an issue, but is specific to authenticated proxies only?
root@vprddock01:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
The proxy settings show in the environment when it’s a straight-forward proxy server:port, but not when it’s a user:pass@server:port configuration if the username or password contains special characters that need to be url-encoded. As soon as the ‘%’ sign is in the string, the This works fine in my Ubuntu 16.04 box but the same does not work in my 18.04 box:
Thanks, this works.
I copied the proxy string directly from bash export, didn’t work. It was: http://username:p%40ssword@hostname:123
After changed to below, it works: http://username:p@ssword@hostname:123
(Docker 18.09.7 on Ubuntu 18.04.3 LTS)
Hi
I experience the same issue.
As soon as I urlencode the password and ‘%’ is used in the URL the Environment is not set => docker does not use proxy
But when I write the password without encoding the Environment is set but docker give me an error about malformed URL => still without proxy.
Is there any ticket at docker or ubuntu open about this?
i901:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
I spent nearly a week on this issue and finally found the answer. The issue is not with Docker but is with systemctl and how it reads the config files. Systemctl requires different escape characters than a URL does so a proxy var with special URL characters needs to have then escaped with the hex equivalent and the systemctl escapes.
So a backslash in domain\user becomes domain%5Cuser but this breaks systemctl because of the % sign.
What I found is that systemctl uses doubles to escape special characters like % and $
So what you need for systemctl with a url and special chars is domain%%5Cuser (Notice the DOUBLE %).
i spent a week in this issue…searching thru lot of posts … no body has written anything about this problem with special characters…thanks a lot for your post…it solved the problem when i was almost about to leave the installation.
I realize this is an old post but I assume people are still having the issue as I just did. You might want to try removing the quotes when adding the proxies to a .conf file. With the quotes I was not seeing any proxies defined when running:
[Service]
Environment=HTTP_PROXY=“http://10.0.1.60:3128”
Environment=HTTPS_PROXY=“http://10.0.1.60:3128”
Environment=NO_PROXY=“localhost,127.0.0.1”
sudo systemctl show --property=Environment docker
Environment=
However, when I removed the “” from the below config it worked
Don’t forget to run sudo systemctl daemon-reload