搭建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

相关推荐

  1. Docker私有仓库

    2024-07-14 09:10:02       58 阅读
  2. docker私有仓库

    2024-07-14 09:10:02       26 阅读
  3. 使用docker『Gitea』私有仓库

    2024-07-14 09:10:02       56 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-14 09:10:02       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-14 09:10:02       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-14 09:10:02       57 阅读
  4. Python语言-面向对象

    2024-07-14 09:10:02       68 阅读

热门阅读

  1. uvm中使用clone时,为什么要使用$cast

    2024-07-14 09:10:02       22 阅读
  2. Linux命令怎么背?

    2024-07-14 09:10:02       20 阅读
  3. OpenCV npy和txt文件的区别与使用

    2024-07-14 09:10:02       26 阅读
  4. 使机器人在执行任务时更加稳定

    2024-07-14 09:10:02       26 阅读
  5. CSS 样式缓存不更新

    2024-07-14 09:10:02       23 阅读
  6. 基于go-zero二次开发的脚本

    2024-07-14 09:10:02       20 阅读