报错

The push refers to a repository [192.168.1.161:5000/hello-world]
Get https://192.168.1.161:5000/v1/_ping: http: server gave HTTP response to HTTPS client

原因

docker私有仓库服务器,默认是基于https传输的,所以我们需要在客户端127.0.0.1做相关设置,不使用https传输

解决步骤

[root@localhost ~]# vi /etc/docker/daemon.json

将下面的代码放进去保存并退出。

"insecure-registries":["127.0.0.1:5000"]

最终如下所示:

{
        "registry-mirrors": ["https://njrds9qc.mirror.aliyuncs.com"],
        "insecure-registries":["127.0.0.1:5000"]
}

依次执行下面两条命令,重新启动docker

[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker

 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐