MMRA
MMRA

Reputation: 347

Docker does not work behind proxy

unfortunately, I can't use my docker behind the proxy , I do what googling search suggest and this is the error I get when I run sudo docker run hello-world:

Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-
1.docker.io/v2/: Proxy Authentication Required.
See 'docker run --help'.

this is my '/etc/systemd/system/docker.service.d/http-proxy.conf' file :

[Service]
Environment="HTTP_PROXY=http://user:[email protected]:8800/"
Environment="HTTPS_PROXY=https://user:[email protected]:8800/"

my "etc/default/docker" file :

export http_proxy="http://127.0.0.1:3128/"
export https_proxy="http://127.0.0.1:3128/"
export HTTP_PROXY="http://127.0.0.1:3128/"
export HTTPS_PROXY="http://127.0.0.1:3128/"

what is the problem? thank you :)

Upvotes: 7

Views: 13661

Answers (2)

iDeveloper
iDeveloper

Reputation: 1725

Docker is not available is some countries because of some unfair sanctions by US which are targeting people directly also startups ...

Any way you can use registry docker instead of docker_hub. But for creating images and container from micro-services and projects and run them (local) you check this Link

All the best :)

Upvotes: 0

Saran
Saran

Reputation: 1575

try this,

$ sudo vim /etc/resolv.conf

#add these lines on top and above one for home router…
nameserver 8.8.8.8
nameserver 8.8.4.4

After saving the /etc/resolv.conf file.

run $ sudo systemctl daemon-reload for reloading daemon process.

Then restart your docker :

run $ sudo systemctl restart docker

Upvotes: 3

Related Questions