Distribution Registry是由容器部署,所有前提是需要安装docker
参考文档:https://docs.docker.com/engine/install/centos/
Registry 官网文档 https://distribution.github.io/distribution/
-
安装Registry仓库
docker run -d -p 5000:5000 --restart=always --name registry registry:2
-
从docker镜像仓库拉取一个 busybox镜像
docker pull busybox
-
使用tag 修改 busybox的标签,格式为 注册仓库IP(域名):仓库端口/镜像名称
docker image tag busybox localhost:5000/busybox
Tip:原 busybox 镜像标签被修改不会消失,而是生成一个带有新的新的标签容器,容器ID和原 busybox一致。
-
将修改后buxybox推送到自己创建的仓库中
docker push localhost:5000/busybox
-
拉取刚刚推送的镜像 localhost:5000/busybox
Tip:删除掉已经存在的localhost:5000/busybox镜像在进行拉取: docker rmi localhost:5000/busyboxdocker pull localhost:5000/busybox
-
删除注册仓库并删除所有数据
docker stop registry && docker container rm -v registry
- volume 默认是不删除的,使用 -v 删除volume