Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lookup registry-1.docker.io: no such host

Tags:

docker

ubuntu

I have docker daemon running on my Ubuntu 16.4 server

my server details:

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 17.04 Release: 17.04 Codename: zesty

I'm receiving the following error:

aa@aaa-VirtualBox:/etc/default$ docker run hello-world Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io: no such host. See 'docker run --help'. 

I have set the http_proxy and the https_proxy beacuse i'm behind a corp proxy/firewall

Any clues how I can fix this issue?

like image 340
Tal Avissar Avatar asked Sep 04 '17 11:09

Tal Avissar


People also ask

What is https registry 1 docker io?

"https://registry-1.docker.io"] # ... As for where registry-1.docker.io comes from, it's the DNS name for the Docker Hub registry, which is the default when you do not specify a registry in your image name. Follow this answer to receive notifications.

What is docker IO library registry?

A registry is a storage and content delivery system, holding named Docker images, available in different tagged versions. Example: the image distribution/registry , with tags 2.0 and 2.1 . Users interact with a registry by using docker push and pull commands.

What is registry host in docker?

For information about Docker Hub, which offers a hosted registry with additional features such as teams, organizations, web hooks, automated builds, etc, see Docker Hub. Before you can deploy a registry, you need to install Docker on the host. A registry is an instance of the registry image, and runs within Docker.

How do I access docker registry?

Sign into your Docker Hub account as an organization owner. Select an organization, navigate to the Settings tab on the Organizations page and click Registry Access.


1 Answers

You need to set the proxy for Docker daemon also using environment variable. Docker run is also doing docker pull since the image doesn't exists. In your case the proxy is only applied to the docker run command, which delegates to the docker daemon which is running without proxy.

Create a file named /etc/systemd/system/docker.service.d/10_docker_proxy.conf with below content

[Service] Environment=HTTP_PROXY=http://1.1.1.1:111 Environment=HTTPS_PROXY=http://1.1.1.1:111 

Make sure to update the proxy as per the ones you have 1.1.1.1:111 is just an example

Then execute below commands to restart docker

sudo systemctl daemon-reload sudo systemctl restart docker 

Now use your docker run command and it should work

like image 110
Tarun Lalwani Avatar answered Sep 18 '22 07:09

Tarun Lalwani