在这里插入代码片
# 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
- 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"]
}
- restart docker
systemctl restart docker
systemctl status docker
- Run again
docker run hello-world
to pull the image again, and finally succeeded! sleep!