Docker Registry 私有仓库使用
私有仓库安装
docker run -d -p 5000:5000 --restart=always --name registry registry
推送到私有仓库
docker tag image:latest 192.168.1.100:5000/image:latest
docker push 192.168.1.100:5000/image:latest
查看仓库中的镜像
curl 127.0.0.1:5000/v2/_catalog
客户端使用方法
# 配置仓库
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
],
"insecure-registries": [
"192.168.1.100:5000"
]
}
service docker restart
# 拉取镜像
docker pull 192.168.1.100:5000/image:latest