1:下载Registry镜像


导入镜像到本地中
root@localhost \~\]# docker load -i registry.tag.gz

进行检查

2:开启Registry
registry开启的端口号为5000
root@localhost \~\]# docker run -d -p 5000:5000 --restart=always registry \[root@localhost \~\]# docker ps

3:上传镜像到仓库中
root@localhost \~\]# docker tag nginx:v3 172.25.254.200:5000/nginx.v3 \[root@localhost \~\]# docker push 172.25.254.200:5000/nginx.v3

docker在上传的过程中默认使用https,但是我们并没有建立https认证需要的认证文件所以会报错
配置非加密端口为本地虚拟机的IP地址。
root@localhost \~\]# vim /etc/docker/daemon.json { "insecure-registries":\["http://172.25.254.200:5000"
}

重启docker
root@localhost \~\]# systemctl start docker

4:上传镜像
root@localhost \~\]# docker push 172.25.254.200:5000/nginx.v3

root@localhost \~\]# docker inspect happy_colden

数据挂载目录的位置
进入到数据挂载目录的位置,里面存在上传镜像nginx.v3

快捷方式访问
root@localhost \~\]# curl 172.25.254.200:5000/v2/_catalog {"repositories":\["nginx.v3"\]}
总结
将本地的镜像推送到私有仓库中
root@localhost \~\]# docker tag busybox:latest 172.25.254.200:5000/busybox:latest
打上标签,上传镜像
root@localhost \~\]# docker push 172.25.254.200:5000/busybox:latest
