1、下载镜像Docker Registry
docker pull registry:2.7.1
2、运行私有库Registry
docker run -d -p 5000:5000 -v ${PWD}/registry:/var/lib/registry --restart=always --name registry registry:2.7.1
3、拉取镜像
docker pull busybox
4、打标签,修改IP,192.168.xxx.xxx,加镜像的名称
docker tag busybox:latest 192.168.xxx.xxx:5000/bosybox:v1.0
5、编辑配置/etc/docker/daemon.json文件,修改IP,192.168.xxx.xxx
vi /etc/docker/daemon.json
{"insecure-registries":["192.168.xxx.xxx:5000"]
}
6、重启
systemctl restart docker
7、推送至仓库,修改IP,192.168.xxx.xxx
docker push 192.168.xxx.xxx:5000/bosybox:v1.0
8、查看仓库镜像,修改IP,192.168.xxx.xxx
curl http://192.168.xxx.xxx:5000/v2/_catalog