故障描述:

[root@docker01 ~]# docker run centos
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

解决方案:

修改docker镜像源:

docker默认的源为国外官方源,下载速度较慢,可改为国内,加速

方案一

修改或新增 /etc/docker/daemon.json

[root@docker01 ~]# vi /etc/docker/daemon.json
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
} [root@docker01 ~]# systemctl restart docker.service

方案二

修改或新增 /etc/sysconfig/docker,在OPTIONS变量后追加参数  --registry-mirror=https://docker.mirrors.ustc.edu.cn

[root@docker01 ~]# vi /etc/sysconfig/docker
OPTIONS='--selinux-enabled --log-driver=journald --registry-mirror=https://docker.mirrors.ustc.edu.cn'

Docker国内源说明:

Docker 官方中国区:https://registry.docker-cn.com

网易:http://hub-mirror.c.163.com

中国科技大学:https://docker.mirrors.ustc.edu.cn

阿里云:https://pee6w651.mirror.aliyuncs.com

最终我用下面的方案解决了:

进入/etc/docker

查看有没有 daemon.json。这是docker默认的配置文件。

如果没有新建,如果有,则修改。

[root@docker01 ~]# vi daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com"]
}

保存退出。

重启docker服务

[root@docker01 ~]#  systemctl restart docker.service

成功!

docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled的更多相关文章

  1. 私有Docker仓库login Error response from daemon: Get https://x.x.x.x/v2/: dial tcp x.x.x.x:443: connect: connection refused

    一.登陆私有仓库错误: docker login --username=evan 192.168.0.203 Error response from daemon: Get https://192.1 ...

  2. docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers).

    docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled ...

  3. 解决报错Error response from daemon: Get https://10.0.0.110/v2/: dial tcp 10.0.0.110:443: connect: connection refused

    修改 #https不需要验证,否则要加上以下配置# 意思就是非安全仓库,加上重启就OK了! vim /lib/systemd/system/docker.service --insecure-regi ...

  4. docker从私有镜像库pull/push镜像问题:Error response from daemon: Get https://xxxx.com/: x509: certificate signed by unknown authority

    docker从私有镜像库pull/push镜像问题:Error response from daemon: Get https://harbor.op.xxxx.com/v2/: x509: cert ...

  5. docker配置国内镜像地址,解决无法pull镜像问题docker: Error response from daemon

    问题: 执行命令 $ docker run -it --rm -p 8888:8080 tomcat:8.5.32 报错 Unable to find image 'tomcat:8.5.32' lo ...

  6. 解决 docker: Error response from daemon: ... : net/http: TLS handshake timeout.

    参考:解决 Docker pull 出现的net/http: TLS handshake timeout 的一个办法 问题: 执行 $ sudo docker run hello-world 时出现: ...

  7. Docker获取镜像报错docker: Error response from daemon

    docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled ...

  8. Error response from daemon: Get https://registry-1.docker.io/v2/library/nginx/manifests/1.14-alpine: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fnginx%3Apull&service=registry.docker.

    docker pull 镜像时报错: Error response from daemon: Get https://registry-1.docker.io/v2/library/nginx/man ...

  9. docker login harbor出现的报错Error response from daemon: Get https://172.16.1.99/v1/users/: dial tcp 172.16.1.99:443: getsockopt: connection refused解决方法

    出现的问题 [root@master01 ~]# docker login 172.16.1.99 Username: admin Password: Error response from daem ...

随机推荐

  1. Currency Exchange(SPFA判负环)

    Several currency exchange points are working in our city. Let us suppose that each point specializes ...

  2. java初探(1)之登录再探

    https://www.cnblogs.com/lovejune/p/java_login_1.html 上一章内容搭建起了登录应用场景的环境,模拟实现了登录操作,页面与后端数据的交互过程,使用的是异 ...

  3. 小程序开发-媒体组件image

    image 图片组件,支持 JPG.PNG.SVG.WEBP.GIF 等格式,2.3.0 起支持云文件ID. 所有属性如下: Tips image组件默认宽度320px.高度240px image组件 ...

  4. 测试JsonAnalyzer解析Json的十一个测试用例

    目测以下测试用例都是通过的. 01. 原文={"status":"","message":"success"," ...

  5. 经典SQL问题:Top 10%

    学生表: create table hy_student( id number(4,0) primary key, name nvarchar2(20) not null, score number( ...

  6. IFile、File与实体转换

    /** * 根据物理实体文件在开发工程中创建实体文件 */ @Override public void getEntityFilesByErFile(IFile erfile, IFolder ent ...

  7. netty如何进行单元测试

    一种特殊的Channel 实现——EmbeddedChannel,它是Netty 专门为改进针对ChannelHandler 的单元测试而提供的. 将入站数据或者出站数据写入到EmbeddedChan ...

  8. 判断语句 、 while循环 、 for循环

    判断语句 语法结构 if 条件1: 如果条件1为真,执行语句块 elif 条件2: 如果条件2为真,执行语句块 elif 条件3: 如果条件2为真,执行语句块 elif 条件n: 如果条件n为真,执行 ...

  9. 从头看看Tomcat启动Spring容器的原理

    通过带注解Spring Boot可以启动一个web容器,并初始化bean容器.那么Tomcat启动并初始化spring容器的原理是怎样的? Tomcat启动web程序时会创建一对父子容器(图1): 有 ...

  10. 【小白学PyTorch】10 pytorch常见运算详解

    参考目录: 目录 1 矩阵与标量 2 哈达玛积 3 矩阵乘法 4 幂与开方 5 对数运算 6 近似值运算 7 剪裁运算 这一课主要是讲解PyTorch中的一些运算,加减乘除这些,当然还有矩阵的乘法这些 ...