1.拉取私有仓库镜像
[root@jeames ~]# docker pull registry Using default tag: latest
2.启动私有仓库容器
docker run -di --name registry -p 5000:5000 registry docker update --restart=always registry --开机自启动 docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Status}}"
访问网址:http://192.168.1.54:5000/v2/_catalog
3.设置信任
[root@jeames ~]# vi /etc/docker/daemon.json { "registry-mirrors":["https://docker.mirrors.ustc.edu.cn"], "insecure-registries":["192.168.1.54:5000"] } [root@jeames ~]# systemctl restart docker --重启docker
4.上传本地镜像
[root@jeames ~]# docker images [root@jeames ~]# docker tag postgres:11 192.168.1.54:5000/postgres
[root@jeames ~]# docker push 192.168.1.54:5000/postgres
5.重新拉取镜像
[root@jeames ~]# docker rmi 192.168.1.54:5000/postgres [root@jeames ~]# docker images [root@jeames ~]# docker pull 192.168.1.54:5000/postgres