Docker私有仓库
更新:HHH   时间:2023-1-7


拉取私有仓库镜像

执行命令:docker pull registry
如果提示:

error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/
解决方法:

systemctl stop docker
echo "DOCKER_OPTS=\"\$DOCKER_OPTS --registry-mirror=http://f2d6cb40.m.daocloud.io\"" | sudo tee -a /etc/default/docker
 service docker restart

再次执行:docker pull registry

启动私有仓库容器

docker run -di --name=registry -p 5000:5000 registry

验证是否成功:

浏览器查看:
http://192.168.128.128:5000/v2/_catalog

看到{"repositories":[]} 表示私有仓库搭建成功并且内容为空

修改daemon.json

vim /etc/docker/daemon.json
添加以下内容,保存退出

{"insecure-registries":["192.168.128.128:5000"]}

用于让 docker信任私有仓库地址

重启docker 服务

systemctl restart docker
返回建站服务器教程...