Im using centos 7.7 and docker 19.03.
I cannot pull images and getting :
Error response from daemon: Get https://registry-1.docker.io.v2./: dial tcp lookup : server misbehaving
I did what all guides on google suggested:
cat /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Enviroment="HTTP_PROXY=http://myproxy"
systemctl deamon reload
systemctl restart docker
and nothing happends.
if i do echo $http_proxy i see my settings.
more settings:
/etc/enviroment
http_proxy=http://myproxy
https_proxy=https://myproxy
The proxy setting used to work and is working on another server.
On this server i had deleted docker old versions :
docker-1.13.1
docker-common-1.13.1
docker-client-1.13.1
With the older docker it seems to work but with docker-ce it doesnt.
I even rebooted and reinstalled again.
3
Answers
Solved it! I guess because i am using Centos then doing
systemctl restart docker
didnt really work.Created the directory :
Create the file :
Add the following line:
Restart daemon:
And this restart method worked:
and then it accepted all the env vars
Set both variables, and they can both be set to your http server. The variable is for the type of traffic being proxied, not the protocol to the proxy server:
The latest documentation detailing the configuration of Docker to use Proxy server worked for me to build my latest docker image.
For latest docker clients (>= v17.07) create or edit the file ~/.docker/config.json
For older docker clients (<= v17.06) use the –env flag to set the proxy accordingly