[root@192-168-166-119 ~]# docker push 192.168.166.220:5000/centosmyregistry
The push refers to a repository [192.168.166.220:5000/centosmyregistry] (len: 1)
unable to ping registry endpoint
v2 ping attempt failed with error: Get tls: oversized record received with length 20527
v1 ping attempt failed with error: Get tls: oversized record received with length 20527
[root@192-168-166-119 ~]# telnet 192.168.166.220 5000
Trying 192.168.166.220...
Connected to 192.168.166.220.
Escape character is '^]'.
出现这个问题是CA证书问题,修改/etc/sysconfig/docker文件,把INSECURE_REGISTRY='--insecure-registry'注释取消,修改成:
[root@192-168-166-119 ~]# vim /etc/sysconfig/docker
INSECURE_REGISTRY='--insecure-registry 192.168.166.220:5000'
192.168.166.220:5000是我的registry的地址.
记得要重启服务
[root@192-168-166-119 ~]# systemctl restart docker
可以上传了
[root@192-168-166-119 ~]# docker push 192.168.166.220:5000/centosmyregistry
The push refers to a repository [192.168.166.220:5000/centosmyregistry] (len: 1)
bb3d629a7cbc: Pushed
a63aae4d216f: Pushed
6fdebd7b0eb5: Pushed
47d44cb6f252: Pushed
latest: digest: sha256:3fca4350643d07d50244b3f24d2b47aabf493c3f7e6c9739af84129bbc52cb5f size: 7225
可以看到仓库中已经有了刚才上传的image
[root@192-168-166-119 ~]# curl -X GET
{"name":"centosmyregistry","tags":["latest"]}
阅读(11065) | 评论(0) | 转发(0) |