I installed latest docker version on remote Centos7.2 (version 18.01.0.ce) according the docker install instruction.
My docker client and docker server are on the same machine (Virtual machine). when running sudo docker run hello-world
I get
"Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/ : >net/http: request canceled while waiting for connection (Client.Timeout >exceeded while awaiting headers). See 'docker run --help'."
Any suggestions on how to solve it?
The first time you run docker container run hello-world
the system will not be able to find the image(container) locally so it should automatically attempt to download the container - it did in my case.
Also looks like a connection issue with docker.io you might want to try later or check your internet connection settings.
Make sure you have internet access on that virtual machine.
When you run non-existing docker image, docker engine connects to docker hub and download that image.
I have also met this issue when I try to run centos 7 docker from docker hub:
docker run -it centos:7
The first message issued was:
Unable to find image 'centos:7' locally
After a while, I saw the following message:
7: Pulling from library/centos Digest: sha256:307835c385f656ec2e2fec602cf093224173c51119bbebd602c53c3653a3d6eb Status: Downloaded newer image for centos:7
Then I am able to go inside the container.
Setting up proxies and DNS settings were of no use in my case.
After extensive research for a couple of days, I was able to overcome the issue using below steps in docker-toolbox bash:
$ docker-machine stop default
$ docker-machine rm default
$ docker-machine create --driver virtualbox default
Verify if the machine is runnning. ACTIVE attribute should be marked *: $ docker-machine ls
If the machine is not running, run the machine: $ docker-machine run default
Then, run hello-world, you will get below screen in your bash
Hope it help you guys and save your time!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.