1.拉取registry镜像
docker pull registry

2.修改daemon.json文件
vi /etc/docker/daemon.json
daemon.json配置:
{
“registry-mirrors”: [“https://xxxxxx.mirror.aliyuncs.com”],
“insecure-registries”: [“xxx.xx.xx.xx:5000”]
}
registry-mirrors是配置镜像加速地址,从阿里云注册获取
insecure-registries 选择性添加,xx记得替换成自己的ip地址
3.重启docker
systemctl restart docker

4.启动容器

docker run -d -p 5000:5000 --restart always --name registry registry:latest
5.浏览器访问

6.测试下载镜像

7.修改镜像名称及标签
docker tag hello-world:latest xx.xx.xx.xx:5000/hello-world:latest

8.push到自己的私有仓库
docker push xx.xx.xx.xx:5000/hello-world:latest

9.registry仓库镜像存放位置

docker exec -it 3d4dbc619be8 sh
cd /var/lib/registry/docker/registry/v2/repositories

