美文网首页
解决centos7下拉取镜像时报错:net/http: TLS

解决centos7下拉取镜像时报错:net/http: TLS

作者: A0小何 | 来源:发表于2018-04-15 22:55 被阅读0次

    描述:在拉取镜像时,一直处于等待状态,等待了几十秒后,抛出异常:

    error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/d8/d8f08f881e97b6d9f92869887bf5c283c841827e2ce8542207db3fbbe0cf29a2/data?Expires=1522360411&Signature=EhzTBCUvgGMTTX0HVUZbO0waQ6XBEwe13LhGYpVUEZacP3eU--DjR-YCeerQnpb3ZKJmapikxNGiHwK1RBsWZ4SnA2exCc4wZLMhRC88Z8euCvQ7YU0SOhQruChIWezYDbGiWC2sYMmqMdLbHbK8JP9ZCu34hI~iBCISXLHxX0M_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: net/http: TLS handshake timeout
    

    原因很简单,在拉取镜像时,超时了,有两种方式解决

    • 一种是变更超时时间
    • 另一个比较好的方法是修改系统中默认的镜像源
      如果是镜像源有问题,比如很多网络受限,建议使用第二种方式。

    修改系统配置文件/etc/sysconfig/docker

    添加镜像仓库--registry-mirror=http://f2d6cb40.m.daocloud.io

    OPTIONS=' --selinux-enabled --log-driver=journald --registry-mirror=http://f2d6cb40.m.daocloud.io'
    重启docker服务

    service docker restart
    再次拉取成功,问题解决

    相关文章

      网友评论

          本文标题:解决centos7下拉取镜像时报错:net/http: TLS

          本文链接:https://www.haomeiwen.com/subject/hbplkftx.html