Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker does not work behind proxy

Tags:

docker

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 :)

like image 561
MMRA Avatar asked Dec 02 '17 12:12

MMRA


People also ask

Does Docker use system proxy?

In Docker 17.07 and higher, you can configure the Docker client to pass proxy information to containers automatically. In Docker 17.06 and earlier versions, you must set the appropriate environment variables within the container.

Do you need a HTTP proxy Docker?

A proxy is required when the server running Docker does not have direct access to the Internet. Configure the Docker daemon to use a proxy server to access images stored on the official Docker Hub Registry or 3rd-party registries.

What is container process proxy?

Introduction. ContainerProxy is an application that launches and manages containers for users, to perform specific tasks. Examples include: Run interactive Shiny apps. Execute long-running R jobs.


1 Answers

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

like image 105
Saran Avatar answered Sep 21 '22 05:09

Saran