使用docker拉取镜像一直网路拒绝连接
报错信息如下:
Unable to find image 'mysql:8.0.29' locally
8.0.29: Pulling from library/mysql
e54b73e95ef3: Retrying in 1 second
327840d38cb2: Retrying in 1 second
642077275f5f: Retrying in 1 second
e077469d560d: Waiting
cbf214d981a6: Waiting
7d1cc1ea1b3d: Waiting
d48f3c15cb80: Waiting
94c3d7b2c9ae: Waiting
f6cfbf240ed7: Waiting
e12b159b2a12: Waiting
4e93c6fd777f: Waiting
docker: error pulling image configuration: download failed after attempts=6: dial tcp 128.242.24 5.93:443: connect: connection refused.
See 'docker run --help'.
1、配置阿里云的镜像和中科院的(对我来说不管用)
2、添加多个镜像(可以!)
① 编辑配置文件
vi /etc/docker/daemon.json
② 在配置文件中加入如下镜像:
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://docker.mirrors.ustc.edu.cn",
"https://docker.nju.edu.cn"
]
i可以进入编辑状态,写完按esc健推出,最后:wq强制退出并保存。
③ 重启Docker服务:
sudo systemctl daemon-reload
sudo systemctl restart docker
最后结果:
Unable to find image 'mysql:8.0.29' locally
8.0.29: Pulling from library/mysql
e54b73e95ef3: Pull complete
327840d38cb2: Pull complete
642077275f5f: Pull complete
e077469d560d: Pull complete
cbf214d981a6: Pull complete
7d1cc1ea1b3d: Pull complete
d48f3c15cb80: Pull complete
94c3d7b2c9ae: Pull complete
f6cfbf240ed7: Pull complete
e12b159b2a12: Pull complete
4e93c6fd777f: Pull complete
Digest: sha256:152cf187a3efc56afb0b3877b4d21e231d1d6eb828ca9221056590b0ac834c75
Status: Downloaded newer image for mysql:8.0.29
9665871cd79a19e8d32c81d0b21d50e69ba7ad3f7ba3a4cd02bdbcc7eff4fc63
查看一下吧:
[root@localhost ~]# docker ps标签:Pull,29,tcp,拉取,mysql,镜像,docker,网路 From: https://www.cnblogs.com/xydchen/p/18258781
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9665871cd79a mysql:8.0.29 "docker-entrypoint.s…" 8 minutes ago Up 8 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mysql