The push refers to a repository(docker报错解决方案)--docker 推送镜像到私有镜像仓库遇到的坑
报错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传输的,所以我们需要在客户端1...
报错
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
————————————————
备注:daemon.json 此文件没有的话,可以新增此文件!!
但是如果此文件内容错误的话,可能docker 启动不了。切记!!
[root@localhost ~]# systemctl start docker
Job for docker.service failed because start of the service was attempted too often. See "systemctl status docker.service" and "journalctl -xe" for details.
To force a start use "systemctl reset-failed docker.service" followed by "systemctl start docker.service" again.
版权声明:本文为CSDN博主「养柱专业户」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/haodiaoer/article/details/94835649
更多推荐
所有评论(0)