创建仓库
docker run -d -p 5000:5000 --restart=always --name registry -v /opt/myregistry:/var/lib/registry registry
修改配置文件,使之支持http
/etc/docker/daemon.json 中
{
"registry-mirrors": ["https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.100:5000"] (对应访问的地址)
}
systemctl restart docker.service
docker tag busybox:latest 10.0.0.100:5000/clsn/busybox:1.0
docker push 10.0.0.100:5000/clsn/busybox
docker pull 10.0.0.100:5000/clsn/busybox:1.0
10.0.0.100:5000/clsn/ 成为一个私有仓库
网友评论