docker镜像pull不下来最终解决方法
pull镜像wordpress下来,但是出现如下错误:
# docker pull wordpress:latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaitin headers)
查看日志,发现出现如下错误:
#tailf /var/log/messages
Aug 19 16:46:29 docker02 dockerd: time="2019-08-19T16:46:29.157861585+08:00" level=warning msg="Error getting v2 registry: Get https://registry.docker-cn.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Aug 19 16:46:29 docker02 dockerd: time="2019-08-19T16:46:29.157965774+08:00" level=info msg="Attempting next endpoint for pull after error: Get https://registry.docker-cn.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Aug 19 16:46:44 docker02 dockerd: time="2019-08-19T16:46:44.158651847+08:00" level=warning msg="Error getting v2 registry: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Aug 19 16:46:44 docker02 dockerd: time="2019-08-19T16:46:44.158907684+08:00" level=info msg="Attempting next endpoint for pull after error: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Aug 19 16:46:44 docker02 dockerd: time="2019-08-19T16:46:44.159189201+08:00" level=error msg="Handler for POST /v1.40/images/create returned error: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
发现是因为docker加速器超时导致pull不下来
查看加速器:/etc/docker/daemon.json
# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.12:5000"]
}
导致此问题产生,主要是因为国家把docker国外镜像hub封掉了,导致镜像pull不下来,为此,改用国内的镜像
# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com","https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.12:5000"]
}
#systemctl restart docker
# docker pull wordpress:latest
latest: Pulling from library/wordpress
1ab2bdfe9778: Pulling fs layer
1448c64389e0: Pulling fs layer
4b8a4e62b444: Pulling fs layer
9eb9d1e8e241: Pulling fs layer
d20b2d19292c: Pull complete
023060ea5930: Pull complete
a7fa99bc84ac: Pull complete
138ec8da18f2: Pull complete
cd4dae5ac262: Pull complete
c90eff48869a: Pull complete
1bc49f4d3a43: Pull complete
e3bb2b10f58d: Pull complete
fd7b454ec570: Pull complete
6096f23889f4: Pull complete
81072ed817d5: Pull complete
ecce7df16ad3: Pull complete
f4475635015e: Pull complete
bad34b7324ad: Pull complete
890f49d5ad8a: Pull complete
7e4ee285d305: Pull complete
Digest: sha256:6566a68d0c613304aa11255d98aba6e29c5fa8cd8497064639343956a4c7d2b1
Status: Downloaded newer image for wordpress:latest
docker.io/library/wordpress:latest
可以正常Pull下来了。
docker镜像pull不下来最终解决方法的更多相关文章
- 精简Docker镜像的五种通用方法
http://dockone.io/article/8163 精简Docker镜像的好处很多,不仅可以节省存储空间和带宽,还能减少安全隐患.优化镜像大小的手段多种多样,因服务所使用的基础开发语言不同而 ...
- 解决docker镜像pull超时问题
第一步:通过dig @114.114.114.114 registry-1.docker.io找到可用IP dig @114.114.114.114 registry-1.docker.io 第二步: ...
- 第四章 使用Docker镜像和仓库
第4章 使用Docker镜像和仓库 回顾: 回顾如何使用 docker run 创建最基本的容器 $sudo docker run -i -t --name another_container_mum ...
- 如何构建Docker镜像
构建Docker 镜像有如下两种方法: (一)使用docker commit命令.(二)使用docker build命令和 Dockerfile 文件.在这里并不推荐使用docker commit来构 ...
- Maven Docker镜像使用技巧
摘要: Maven是目前最流行的Java项目管理工具之一,提供了强大的包依赖管理和应用构建功能.本文以Maven为例介绍了Docker在应用构建中的一些常见技巧. Maven是目前最流行的Java项目 ...
- 使用 buildx 构建多平台 Docker 镜像
原文链接:使用 buildx 构建多平台 Docker 镜像 在工作和生活中,我们可能经常需要将某个程序跑在不同的 CPU 架构上,比如让某些不可描述的软件运行在树莓派或嵌入式路由器设备上.特别是 D ...
- Docker镜像的构建(五)
目录 构建镜像 1.使用 commit 命令构建 1.1 运行一个要进行修改的容器 1.2 安装 Apache 软件包 1.3 提交定制容器 2.使用 Dockerfile 构建 2.1 我们的第一个 ...
- 简单谈谈Docker镜像的使用方法_docker
在上篇文章(在Docker中搭建Nginx服务器)中,我们已经介绍了如何快速地搭建一个实用的Nginx服务器.这次我们将围绕Docker镜像(Docker Image),介绍其使用方法.包括三部分: ...
- 制作nginx+php的docker镜像方法
制作nginx+php的docker镜像方法一.准备安装的工具工具:docker-17.06.0-ce.nginx-1.13.2.PHP-5.5.38 .supervisor配置思路:1.安装dock ...
随机推荐
- jvm小白
tomcat设置可被jconsole监控: 在catalina.bat或catalina.sh里面加上. set JAVA_OPTS=-Djava.rmi.server.hostname=127.0. ...
- vue中父组件调用子组件的方法
原文地址 文章目录 什么是组件? 使用组件 组件 什么是组件? 组件 (Component) 是 Vue.js 最强大的功能之一.组件可以扩展 HTML 元素,封装可重用的代码.在较高层面上,组件是自 ...
- XSS练习平台-XSS Challenges
XSS Challenges http://xss-quiz.int21h.jp/ XSS基础不好的建议优先查看 关于XSS中使用到的html编码 js编码各种场景用法 http://su.xmd ...
- [loj#2005][SDOI2017]相关分析 _线段树
「SDOI2017」相关分析 题目链接:https://loj.ac/problem/2005 题解: 把上面的式子拆掉,把下面的式子拆掉. 发现所有的东西都能用线段树暴力维护. 代码: #inclu ...
- SQLite基础-6.运算符
目录 SQLite 运算符 1. 运算符 2. 算数运算符 3. 比较运算符 4. 逻辑运算符 SQLite 运算符 1. 运算符 首先,问大家运算符是什么?运算符在很多领域均用使用.它也分很多中,常 ...
- Vue里标签嵌套限制问题解决------解析DOM模板时注意事项:
受到html本身的一些限制,像<ul>.<ol>.<table>.<select>这样的元素里允许包含的元素有限制,而另一些像<option> ...
- python------模块基础【第二部分-time】------
一.time UTC/GMT:世界时间 本地时间:本地时区时间 python中时间日期格式化符号: %y 两位数的年份表示(00-99) %Y 四位数的年份表示(000-9999) %m 月份(01- ...
- tee、vi/vim命令
一.tee:多重定向 语法: tee [OPTION] ... [FILE] ... 参数: 将标准输入复制到每个FILE,也复制到标准输出. -a,--append ...
- qt 静态编译配置项
configure -confirm-license -opensource -platform win32-msvc2013 -debug-and-release -static -prefix & ...
- hdu 1215 求约数和 唯一分解定理的基本运用
http://acm.hdu.edu.cn/showproblem.php?pid=1215 题意:求解小于n的所有因子和 利用数论的唯一分解定理. 若n = p1^e1 * p2^e2 * ……*p ...