Docker Hub仓库下载镜像网络异常问题的解决

2022-07-13 13:24:48 浏览数 (1)

本文记录下最近在学习Docker容器技术时遇到的一些问题,以此记录下问题分析排查过程

故障问题:

通过docker pull 从公共仓库Docker Hub下载镜像失败

[root@node-11 ~]# docker pull Ubuntu:14.04 Trying to pull repository docker.io/library/ubuntu ... 14.04: Pulling from docker.io/library/ubuntu c2c80a08aa8c: Pulling fs layer 6ace04d7a4a2: Download complete f03114bcfb25: Pulling fs layer 99df43987812: Waiting 9c646cd4d155: Waiting error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/3b/3b853789146f1f249f204a7f29573263ef3486571acb72d7fd8f13056450b807/data?Expires=1524231928&Signature=dVzrl5Nb36kFpSt4jdf6tv5pC87UcHO36sK9vTpWde2rPCVtCEu9pCJlP2iD~xYw50ze5eua0nooo62~f2F6AyfnoYFmLid5sV4H3c0PS2csSFWD7pvvzxEh0Mma8d-kHbWqm7Xa6GCcRM5tgaXXClIZB56HYSa11rZgaofqz6A_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: net/http: TLS handshake timeout

因为本人办公区网络不能再吐槽,导致无法去Docker Hub仓库下载镜像。可以通过配置国内 daocloud镜像源解决这个问题。

编辑/etc/sysconfig/docker配置文件,在OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false 后面添加国内的docker镜像源--registry-mirror=http://f2d6cd40.m.daocloud.io

添加后重启docker 服务,即可解决网络影响下载问题

[root@node-11 ~]# systemctl restart docker [root@node-11 ~]# docker pull ubuntu:14.04 Trying to pull repository docker.io/library/ubuntu ... 14.04: Pulling from docker.io/library/ubuntu c2c80a08aa8c: Pull complete 6ace04d7a4a2: Pull complete f03114bcfb25: Pull complete 99df43987812: Pull complete 9c646cd4d155: Pull complete Digest: sha256:ecc95bdd86160924520fdfafebfbff676cbe278d985fec0797f27d141fcde56b Status: Downloaded newer image for docker.io/ubuntu:14.04

0 人点赞