美文网首页
docker仓库

docker仓库

作者: 口口帅日日 | 来源:发表于2020-04-17 22:36 被阅读0次

1.上传镜像
docker load -i registry.tar.gz 
2.制作仓库
docker run -d -p 5000:5000 --restart=always --name registry -v /opt/myregistry:/var/lib/registry  registry
3.给镜像打tag
docker tag nginx:latest 10.0.0.11:5000/nginx:latest   
4.因为使用的是https
The push refers to repository [10.0.0.11:5000/nginx]
Get https://10.0.0.11:5000/v2/: http: server gave HTTP response to HTTPS client
所以要修改配置文件
[root@master opt]# cat /etc/docker/daemon.json 
{
    "insecure-registries": ["10.0.0.11:5000"]
}
systemctl restart docker
5.推送镜像
docker push 10.0.0.11:5000/nginx:latest
    [root@master opt]# docker push 10.0.0.11:5000/nginx:latest 
The push refers to repository [10.0.0.11:5000/nginx]
55a77731ed26: Pushed 
71f2244bc14d: Pushed 
f2cb0ecef392: Pushed 
latest: digest: sha256:3936fb3946790d711a68c58be93628e43cbca72439079e16d154b5db216b58da size: 948
image.png

harbor私有仓库(默认80)

第一步:安装docker和docker-compose

第二步:下载harbor-offline-installer-v1.5.1.tgz

第三步:上传到/opt,并解压

第四步:修改harbor.cfg配置文件 hostname = 10.0.0.11 harbor_admin_password = 123456

第五步:执行install.sh
image.png

添加https

image.png

相关文章

网友评论

      本文标题:docker仓库

      本文链接:https://www.haomeiwen.com/subject/eicfuhtx.html