初入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啦,什么悬念都没啦~