docker的push无法成功-日记篇

初入docker日记篇

案发现场:

如图,xinqi想把下面的镜像推送到自己的docker仓库:

在这里插入图片描述

后面发现什么目录都无法推送成功,于是通过一顿输出:

[root@xinqi docker]# docker tag xinqiubuntu:1.2 192.168.10.100:5000/xinqiubuntu:1.2
[root@xinqi docker]# docker push 192.168.10.100:5000/xinqiubuntu:1.2
The push refers to repository [192.168.10.100:5000/xinqiubuntu]
Get "https://192.168.10.100:5000/v2/": http: server gave HTTP response to HTTPS client

接下来查看一下:

[root@xinqi docker]# curl -XGET http://192.168.10.100:5000/v2/_catalog
{"repositories":[]}

后面偶尔浮现好像之前还有一个东西没处理,好像是daemon.json这个文件,查看该文件内容:

[root@xinqi docker]# cat daemon.json
{
  "registry-mirrors": ["https://************"],
  "insecure-registries": ["192.168.10.100:5000"]
}

之前是把这个文件修改成这样后,然后就想重新启动docker,就是发现systemctl restart docker这个命令不行,发现连重启都报错:

[root@xinqi docker]# systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

这些信息,应该不会是daemon.json文件的原因,因为xin麒已经检查很多遍了,那些英文符号空格的应该也不会犯这些粗心。

(小插曲:之前又看到网上说把daemon.json的后缀该为conf的方案,但是后面这个方案走不通!)

二、解决

最后通过更新了库文件:

yum update

看来更新yum才是关键!

然后等更新后:

再次:

输入:

[root@xinqi docker]# systemctl restart docker

重新启动之前的内容:

在这里插入图片描述

接下来再输入:

[root@xinqi docker]# docker tag xinqiubuntu:1.2 192.168.10.100:5000/xinqiubuntu:1.2
[root@xinqi docker]# docker push 192.168.10.100:5000/xinqiubuntu:1.2
The push refers to repository [192.168.10.100:5000/xinqiubuntu]
ee4b559a4a46: Pushed 
9f54eef41275: Pushed 
1.2: digest: sha256:bda5f454dfdaf360e840ab32989d85106b61d46785e427f77752da5098c19bf0 size: 741

无报错,成功了

最后再查看一下:

[root@xinqi docker]# curl -XGET http://192.168.10.100:5000/v2/_catalog
{"repositories":["xinqiubuntu"]}

ok啦,什么悬念都没啦~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值