一、本地搭建

1、拉取registry

docker pull registry

2、运行容器

docker run -d -p 5000:5000 --restart=always --name registry -v /opt/registry:/var/lib/registry registry

docker-搭建docker镜像私服

访问http://localhost:5000/v2/_catalog

docker-搭建docker镜像私服

3、上传镜像

①查看已有镜像

docker images

$$

$$

docker-搭建docker镜像私服

②给要上传的镜像打标签

docker tag redis:latest localhost:5000/redis:t1

③推送镜像

docker push localhost:5000/redis:t1

docker-搭建docker镜像私服

浏览http://localhost:5000/v2/_catalog

http://localhost:5000/v2/redis/tags/list

docker-搭建docker镜像私服

④拉取镜像

先删除本地镜像

docker rmi localhost:5000/redis:t1
docker pull localhost:5000/redis:t1

docker-搭建docker镜像私服

相关文章: