运行sudo docker run hello-world

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/": context deadline exceeded


解决方案:

sudo mkdir -p /etc/docker && \
echo '{"registry-mirrors":["https://run-docker.cn"],"dns":["119.29.29.29","114.114.114.114"]}' | sudo tee /etc/docker/daemon.json > /dev/null && \
sudo systemctl daemon-reexec
sudo systemctl restart docker

请运行:sudo docker run hello-world 进行验证

sudo docker run hello-world 

出现

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
e6590344b1a5: Pull complete 
Digest: sha256:7e1a4e2d11e2ac7a8c3f768d4166c2defeb09d2a750b010412b6ea13de1efb19
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

即成功

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐