目录
官网部署文档
1、容器部署
docker 单节点:
mkdir -p /root/container/registry
docker run -itd -p 5000:5000 --restart=always -v /root/container/registry:/var/lib/registry --name registry registry:2
或者使用 compose
部署 如下:
cat docker-compose.yml
version: '2'
services:
registry:
restart: always
image: registry:2
ports:
- 5000:5000
volumes:
- /root/container/registry:/var/lib/registry
运行
docker-compose up -d
2、部署后操作
在 /etc/docker/daemon.json
文件中添加 insecure-registries
键值
vim
{
"insecure-registries": ["本地ip地址:5000"]
}
systemctl daemon-reload
systemctl restart docker
3、上传镜像
以 centos:7
为例子
docker tag centos:7 本地ip地址:5000/centos:7
docker push 本地ip地址:5000/centos:7
4、查看镜像
# 查看镜像
curl http://172.21.0.13:5000/v2/_catalog
# 查看镜像列表
curl http://172.21.0.13:5000/v2/jdk/tags/list
标签:5000,centos,部署,Registry,镜像,docker,Docker,registry
From: https://www.cnblogs.com/qinziteng/p/16917670.html