docker pull registry
[root@zwb_docker mnt]# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://4dlxp4q0.mirror.aliyuncs.com"],
"insecure-registries": ["192.168.159.68:5000"]
}
[root@zwb_docker mnt]# systemctl daemon-reload
[root@zwb_docker mnt]# systemctl restart docker.service
docker run -d -p 5000:5000 -v /data/registry:/tmp/registry registry
-p指定端口,一内一外;
-v表示挂载,前者是宿主机位置,后者是容器位置
docker tag nginx:latest 192.168.159.68:5000/nginx ## 打标签
docker push 192.168.159.68:5000/nginx ##上传至仓库
curl -XGET http://192.168.159.68:5000/v2/_catalog
#删除原有镜像
docker rmi 192.168.159.68:5000/nginx:latest
#查看镜像
docker images
#从本地仓库下载镜像
docker pull 192.168.159.68:5000/nginx
#查看镜像
docker images