docker下载镜像报net/http: TLS handshake timeout
2018-06-01 09:14
1396 查看
问题描述:
在centos7系统上使用命令yum -y install docker安装的docker,在下载镜像的时候速度非常慢,最后镜像下载失败,报“net/http: TLS handshake timeout”的错误:
[root@localhost ~]# docker run -d --restart=unless-stopped -p 8080:8080 -p 9345:9345 rancher/server:stable --db-host 10.0.0.101 --db-port 3306 --db-user rancher --db-pass rancher --db-name rancher --advertise-address 10.0.0.103 Unable to find image 'rancher/server:stable' locally Trying to pull repository docker.io/rancher/server ... stable: Pulling from docker.io/rancher/server bae382666908: Pulling fs layer 29ede3c02ff2: Pulling fs layer da4e69f33106: Pulling fs layer 8d43e5f5d27f: Waiting b0de1abb17d6: Waiting 422f47db4517: Waiting 79d37de643ce: Waiting 69d13e08a4fe: Waiting 2ddfd3c6a2b7: Waiting bc433fed3823: Waiting b82e188df556: Waiting dae2802428a4: Waiting a6247572ea3c: Waiting 884c916ebae4: Waiting 85517c9c5365: Waiting 02dded9fe690: Waiting fd9f433c3bc6: Waiting 44d91b3fea45: Waiting 0d463387dfeb: Waiting 60753c4d26f0: Waiting a003892966fe: Waiting /usr/bin/docker-current: error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/d6/d63b9b4bd2059242e826eaf0cbc879d5728a82cb6ddcd9dcd844bb9257f3fd0a/data?Expires=1521809033&Signature=JBuzPXx14~-I6-mnzBMR5d4At3sU~0TszPc8dhNI45ORRxk8DLXzK-aU3AZk~J-pHdXJ3q6w7w9Y6-WFU8M36FRxFDZC8xwWZE-KVZtZg8mcjC~vAbPiq8RQaSXuk9IieIkTfYoC4mUt2N~lWM34dGuOoyGyuEEIVWISVxu8Uus_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: net/http: TLS handshake timeout. See '/usr/bin/docker-current run --help'. [root@localhost ~]#
原因分析:
docker默认镜像拉取地址为国外仓库下载速度较慢,则会报错“net/http: TLS handshake timeout”。
此时,只需要将拉取地址改为国内镜像仓库即可。
解决过程:
在docker配置文件/etc/sysconfig/docke的OPTIONS中添加“--registry-mirror=https://fzhifedh.mirror.aliyuncs.com”
[root@localhost ~]# vim /etc/sysconfig/docker # /etc/sysconfig/docker # Modify these options if you want to change the way the docker daemon runs #OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false' OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --registry-mirror=https://fzhifedh.mirror.aliyuncs.com ' #换默认源地址 #DOCKER_OPTS="$DOCKER_OPTS --registry-mirror=http://f2d6cb40.m.daocloud.io" if [ -z "${DOCKER_CERT_PATH}" ]; then DOCKER_CERT_PATH=/etc/docker fi # Do not add registries in this file anymore. Use /etc/containers/registries.conf # from the atomic-registries package. #
然后重新下载镜像,速度很快,而且正常了:
[root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6e3e55edcc21 rancher/server:stable "/usr/bin/entry --..." 9 minutes ago Up 9 minutes 3306/tcp, 0.0.0.0:9345->9345/tcp, 0.0.0.0:8080->8080/tcp flamboyant_haibt [root@localhost ~]#
相关文章推荐
- 解决 Docker pull 出现的net/http: TLS handshake timeout 的一个办法
- 解决 docker: Error response from daemon: ... : net/http: TLS handshake timeout.
- 问题:使用docker时报错“net/http: TLS handshake timeout”的解决方案
- docker私有库安装报错处理--net/http: TLS handshake timeout.
- Ubuntu 16.04 安装Docker ,Pull Docker image的时候遇到docker pull TLS handshake timeout
- 关于Docker安装过程中出现 TLS handshake timeout错误的解决办法
- 解决docker在CentOS7下不能下载镜像timeout的问题
- Get https://registry-1.docker.io/v2/library/python/manifests/2.7http: TLS handshake timeout
- Docker在CentOS7下不能下载镜像timeout的解决办法(图解)
- Cloud Foundry 运行bosh create-env时报错: TLS handshake timeout
- Pull Docker image的时候遇到docker pull TLS handshake timeout如何解决?
- Docker Ubuntu TLS handshake failed
- DaoCloud加速docker镜像下载
- 安卓SDK下载国内镜像网站 http://gmirror.org/#android-sdk-tools-only
- 从零开始构建一个centos+jdk7+tomcat7的镜像文件 centos7系统下docker运行环境的搭建 准备centos基础镜像 docker pull centos 或者直接下载我准备
- Docker 私有仓库,上传镜像报错:server gave HTTP response to HTTPS client
- windows下安装docker(纠正报错)+加速下载kali镜像
- 克服跨洋网络延迟,使用Docker Hub Mirror加速Docker官方镜像下载
- 解决docker镜像无法下载的问题