建立私有仓库Registry
2019-07-05 本文已影响0人
暗夜精灵_NightElf
用docker安装(在NODE服务器上)
docker pull registry
运行容器并对应端口在5000上
docker run -p 5000:5000 -v /home/nightelf/registry_images:/var/lib/registry -d registry
修改docker的daemon.json文件
vim /etc/docker/daemon.json
添加上
{
"insecure-registries":["10.20.16.146:5000"],
"registry-mirrors":["https://dcwzscc0.mirror.aliyuncs.com"]
}
重启docker
systemctl daemon-reload
systemctl restart docker
试一下效果
安装nginx
docker pull nginx
打包
docker tag nginx 10.20.16.146:5000/nginx:test
推送自己私有仓库去
docker push 10.20.16.146:5000/nginx:test