前提:
ip:
172.16.0.9
docker:
Version: 18.05.0-ce
1下载registry
docker pull registry
2 建库
将库像放到l永久地址
mkdir /opt/data/registry
docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry
3 客户端添加配置
cat /etc/docker/daemon.json
{
"experimental": true,
"registry-mirrors": ["https://95duqcml.mirror.aliyuncs.com"],
"insecure-registries": [ "http://172.16.0.9:5000" ]
}
#重启生效
systemclt restart docker
确认是否生效
docker info
4测试上传
docker pull busybox
docker tag busybox 172.16.0.9:5000/busybox
docker push 172.16.0.9:5000/busybox2