[SOLVED]Docker installation stepping on the pit: Unable to find image 'hello-world:latest' locally

在这里插入代码片# Problem description
After installing docker, test whether the installation is successful. Running docker run hello-world reports the following error:

# docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate is valid for www.doctorcom.com, not registry-1.docker.io.
See 'docker run --help'.

Solution

  1. Switch the domestic Alibaba Cloud image and create a daemon.json file
vim /etc/docker/daemon.json

Add the following to the file:

 {
    
     
 "registry-mirrors": ["https://alzgoonw.mirror.aliyuncs.com"] 
 }
  1. restart docker
systemctl restart docker
systemctl status docker

insert image description here

  1. Run again docker run hello-worldto pull the image again, and finally succeeded! sleep!

insert image description here

Guess you like

Origin blog.csdn.net/TommyXu8023/article/details/113291112