meets

Setting HTTP proxy for docker

the docker no longer uses the /etc/default/docker file. env properties like HTTP_PROXY and HTTPS_PROXY have to be configured using the systemctl i.e.: https://docs.docker.com/engine/admin/systemd/#http-proxy

sudo mkdir /etc/systemd/system/docker.service.d
	sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
	
cat /etc/systemd/system/docker.service.d/http-proxy.conf   
	[Service]
	Environment="HTTP_PROXY=http://username:password@proxy.host:PORT/" "HTTPS_PROXY=http://username:password@proxy.host:PORT/" 
	

you load the new params like this:

sudo systemctl daemon-reload
	sudo service docker stop
	sudo service docker start
	

and then, if you are lucky, the pull and login to docker.j4care.com will work!!

docker pull busybox
	docker login docker.j4care.com
	docker pull docker.j4care.com:testdata:5.2.1
	

NOTE: similarly, the basic options i.e. TLS and bind params are read from this file:

cat /etc/systemd/system/docker.service.d/dockeropts.conf
	[Service]
	ExecStart=
	ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock -H tcp://10.10.14.81:2375