docker1上创建私有仓库,上传到docker1中,在docker2配置使用docker1的私有仓库,具体可见(harbor技术文档)
docker-distribution私有仓库:
服务器安装仓库主机并启动:
yum install docker-distribution && systemctl start docker-distribution && systemctl enable docker-distribution
打标签:
docker tag docker.io/busybox:latest 192.168.1.31:5000/docker.io/busybox:latest
上传到仓库:
docker push 192.168.1.31:5000/docker.io/busybox:latest
客户机:
更改仓库地址,默认5000端口
vim /etc/sysconfig/docker INSECURE_REGISTRY='--insecure-registry docker1:5000' ADD_REGISTRY='--add-registry docker1:5000'
重启docker,
systemctl restart docker
直接启动,也能先下载
docker run -it myos:http /bin/bash
查看私有仓库
curl http://docker1:5000/v2/_catalog