docker pull 阿里镜像不下来镜像是什么原因

构建Docker registry私有镜像,解决docker私有仓库push出错问题
适用于:Docker 1.8,环境:Centos7
每个版本的docker修改配置内容都不同,请大家看好安装的docker版本。
1)下载 docker registry私有镜像
# docker pull docker.io/registry
2)修改配置文件
# gedit /etc/sysconfig/docker
OPTIONS='--selinux-enabled --insecure-registry 192.168.137.17:5000'
注:红色IP为修改的部分
3)从容器中启动Registry
# docker run -d -p
--name registry -v /home/dockeruser/data:/tmp/registry &docker.io/registry
注:-d 表示该容器在后台运行
-p将主机的5000端口与容器的5000端口映射
--name 将容器的名称命名为registry
-v 表示将镜像的存储位置&/tmp/registry& 变更为宿主机的&/home/dockeruser/data&
注:这一步一定要在步骤2)之后,否则修改配置文件不会生效
4)在上传到私有的registry之前,需要指定新的Registry目的地址,需要在镜像名前加上
主机名和端口的前缀。
#docker images &node/helloworld
得到22d56cbd9e6
#docker tag &22d56cbd9e6 &192.168.137.17:5000/node/helloworld
注:192.168.137.17:5000 为所在主机的IP地址和端口
5)将打标签的镜像上传到私有库
# docker push 192.168.137.17:5000/node/helloworld
显示信息如下:
The push refers to a repository [192.168.137.17:5000/node/helloworld] (len: 1)
Sending image list
Pushing repository 192.168.137.17:5000/node/helloworld (1 tags)
d8bd0657b25f: Image successfully pushed
a582cd499e0f: Image successfully pushed
3c3e582d88fa: Image successfully pushed
625e77fff1a8: Image successfully pushed
a00e4cef421d: Image successfully pushed
fec: Image successfully pushed
c32f3278cf8f: Image successfully pushed
5c88f029bcb1: Image successfully pushed
d3533bde148f: Image successfully pushed
6a06ae308acc: Image successfully pushed
9d: Image successfully pushed
f3c0db6d5143: Image successfully pushed
df45579dbc81: Image successfully pushed
Pushing tag for rev [df45579dbc81] on
{http://192.168.137.17:5000/v1/repositories/node/helloworld/tags/latest}
遇到问题:
The push refers to a repository [192.168.137.17:5000/node/helloworld] (len: 1)
unable to ping registry endpoint https://192.168.137.17:5000/v0/
v2 ping attempt failed with error: Get https://192.168.137.17:5000/v2/: dial tcp 192.168.137.17:5000: connection refused
v1 ping attempt failed with error: Get https://192.168.137.17:5000/v1/_ping: dial tcp 192.168.137.17:5000: connection refused
解决方案:
# gedit /etc/sysconfig/docker
OPTIONS='--selinux-enabled --insecure-registry 192.168.137.17:5000'
注:这一步一定要在创建私有仓库的容器之前【步骤2)】,否则修改配置文件不会生效。
吐槽:网上各种答案都有,确不说明docker是哪个版本。每个版本的docker修改配置内容都不同。
本文永久更新地址:
------分隔线----------------------------Docker push镜像失败解决方法-服务器教程-源码库|专注为中国站长提供免费商业网站源码下载!
当前位置:---Docker push镜像失败解决方法
Docker push镜像失败解决方法
Docker push镜像失败的问题。
以下是输入push自己的tomcat后出现了失败
[root@slave3 ~]# docker push lekkoliu/tomcat8:latest
The push refers to a repository [docker.io/lekkoliu/tomcat8]
cefee3f6c961: Preparing
82f021d9c2b9: Preparing
4f91f02b4e49: Preparing
a4b3ce7e1d4a: Preparing
c3b95f8496f1: Preparing
bcfb53b3ff7c: Waiting
3aa267e87e63: Waiting
6c0ce72ad569: Waiting
a: Waiting
b2ac: Waiting
142a601d9793: Waiting
unauthorized: authentication required
以下是已经执行过的方案:将private hub改变为 public,不能解决这个问题。
解决方案:
这里尤其注意,如果命名方式不对,是不行的。
以我自己的为例:
我docker官方中申请的hub为:
PRIVATE REPOSITORY
这里在执行本地docker push的时候,要先利用docker tag的命令来修改image为符合规范(docker tag username/userimage)的命名。
[root@slave3 ~]# docker tag lekko/liu/tomcat8 lekko/tomcat8
之前我以为username是我整个的名字即lekko/liu。后来我经过多次测试,测出原来这里的username指的是申请的账号,即我的lekko/liu中的lekko。
此时,如上面代码所示,修改后的image名称为lekko/tomcat8。
因此这里把这个image push出去即可。
[root@slave3 ~]# docker push lekko/tomcat8
The push refers to a repository [docker.io/lekko/tomcat8]
cefee3f6c961: Layer already exists
82f021d9c2b9: Layer already exists
4f91f02b4e49: Layer already exists
a4b3ce7e1d4a: Layer already exists
c3b95f8496f1: Layer already exists
bcfb53b3ff7c: Layer already exists
3aa267e87e63: Layer already exists
6c0ce72ad569: Layer already exists
a: Layer already exists
b2ac: Layer already exists
142a601d9793: Layer already exists
latest: digest: sha256:4ca17c9d6cb66c33eaae2b4da size: 2625
此时,可以通过docker 服务器来来取到刚才上传好的镜像:
[root@master ~]# docker pull lekko/tomcat8
Using default tag: latest
latest: Pulling from lekko/tomcat8
6a5a: Pull complete
7b9457ec39de: Pull complete
d5cc639e6fca: Pull complete
dae3b0638638: Pull complete
ab678d1c6f00: Pull complete
d5bf826c3153: Pull complete
0081bad1df81: Pull complete
8fafa3f26de4: Pull complete
aee: Pull complete
4f: Pull complete
2e8f15e74426: Pull complete
Digest: sha256:4ca17c9d6cb66c33eaae2b4da
Status: Downloaded newer image for lekko/tomcat8:latest
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
注:相关教程知识阅读请移步到频道。
相关服务器教程:
热门标签:
服务器教程搜索
服务器教程推荐
热门源码推荐
热门服务器教程
©2012Docker 下载镜像慢的问题解决办法
作者:dounine
字体:[ ] 类型:转载 时间:
这篇文章主要介绍了Docker 下载镜像慢的问题解决办法的相关资料,需要的朋友可以参考下
docker 解决下载镜像慢
使用Docker pull 镜像这个超级慢,因为docker的hub是在国外的,所以是特别慢的,有什么办法可以解决这个问题么?答案肯定是有的,我们可以使用docker的代理的解决这个问题,大家要自己准备一个可以使用的http代理地扯。
此文使用的系统是fedora
创建一个docker service目录
mkdir /etc/systemd/system/docker.service.d
创建 /etc/systemd/system/docker.service.d/http-proxy.conf 文件,把代理地扯写入文件中
vim /etc/systemd/system/docker.service.d/http-proxy.conf
文件内容如下
Environment="HTTP_PROXY=http://代理ip:端口"
让配置文件生效
systemctl daemon-reload
重启docker
systemctl restart docker.service
尝试pull一个镜像看看吧
docker pull jenkins
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具当前位置:
docker pull镜像进程崩溃
docker pull镜像进程崩溃
访问次数: 2
我在centos6.7上面安装docker1.7版本,在pull 镜像docker pull yifli/ionic-framework的时候,镜像下载失败的同时,docker进程崩溃,请问有遇到同样情况,或者有什么解决方法吗?
max volume
full screen
Update Required
To play the media you will need to either update your browser to a recent version or update your .}

我要回帖

更多关于 docker pull镜像源 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信