欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 旅游 > 搭建docker私有仓库

搭建docker私有仓库

2024/11/30 10:30:29 来源:https://blog.csdn.net/zhushixia1989/article/details/140404626  浏览:    关键词:搭建docker私有仓库

1. 无认证私有仓库

  1. 拉取镜像, sudo docker pull registry
  2. 运行registry容器, sudo docker run -dit --restart always --name registry.me -p 8000:5000 -v /registry.me/registry:/var/lib/registry registry
  3. 查看, curl 127.0.0.1:8000/v2/_catalog
  4. 修改tag: sudo docker tag redis 192.168.188.131:8000/redis
  5. 上传镜像: sudo docker push 192.168.188.131:8000/redis
  6. 下载镜像:sudo docker pull 192.168.188.131:8000/redis

问题1: error pulling image configuration: download failed after attempts=6: read tcp 192.168.188.131:40944->104.16.98.215:443: read: connection reset by peer
解决1:
1. vi /etc/docker/daemon.json
2. { "registry-mirrors":[ "https://i1el1i0w.mirror.aliyuncs.com", "https://hub-mirror.c.163.com", "https://registry.aliyuncs.com", "https://registry.docker-cn.com", "https://docker.mirrors.ustc.edu.cn" ] }
3. 重启docker
systemctl daemon-reload
systemctl restart docker
问题2: The push refers to repository [192.168.188.131:8000/redis] Get "https://192.168.188.131:8000/v2/": http: server gave HTTP response to HTTPS client
解决2

  1. vim /etc/docker/daemon.json
  2. 加入insecure-registries 如 { "registry-mirrors":[ "https://i1el1i0w.mirror.aliyuncs.com", "https://hub-mirror.c.163.com", "https://registry.aliyuncs.com", "https://registry.docker-cn.com", "https://docker.mirrors.ustc.edu.cn" ], "insecure-registries":["192.168.188.131:8000"] }
  3. systemctl daemon-reload
  4. systemctl restart docker

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com