docker镜像dns修改

avatar 2020年5月6日18:09:52 评论 1,292 次浏览

今天在安装docker的时候pull下来的镜像既然pull不下来,显示超时。郁闷紧急情况,没办法只有切换一下镜像源。先看一下我安装后的错误提示:

[root@wulaoer.org ~]# docker pull centos
Using default tag: latest
latest: Pulling from library/centos
8a29a15cefae: Downloading [===>                                               ]  4.836MB/73.23MB
error pulling image configuration: Get https://registry-1.docker.io/v2/library/centos/blobs/sha256:470671670cac686c7cf0081e0b37da2e9f4f768ddc5f6a26102ccd1c6954c1ee: net/http: TLS handshake timeout

第一种方法替换镜像源:

[root@wulaoer.org ~]# vim /etc/docker/daemon.json
{
  "storage-driver": "overlay2",
  "storage-opts": ["overlay2.override_kernel_check=true"]
}

替换

[root@wulaoer.org ~]# vim /etc/docker/daemon.json
{
    "registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]
}

或者一换一下dns

54.175.43.85    registry-1.docker.io

这样docker的镜像就能下载了,后期使用docker容器就没问题了,如有其它的问题下次在说。

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: