一、安装docker-registry
docker run --name registry -d -p 5000:5000 --restart=always -v /opt/data/registry:/var/lib/registry registry
二、push镜像
#tag [root@ecs-aece lib]# docker tag xin-demo-hello:latest 127.0.0.1:5000/xin-demo-hello:latest #push [root@ecs-aece lib]# docker push 127.0.0.1:5000/xin-demo-hello:latest
三、查询镜像库
# http://127.0.0.1:5000/v2/_catalog curl 127.0.0.1:5000/v2/_catalog
四、镜像存储路径
五、Docker hub
登录docker hub
#https://hub.docker.com/repositories
#登录docker hub docker login docker.io #登录本地镜像仓库 docker login localhost:5000
push 镜像
#登录docker hub docker login docker.io #commit 建议使用tag docker commit demo-hello windfly521/demo #tag docker tag demo-hello windfly521/demo #push docker push windfly521/demo:latest #备注: windfly521 - docker hub 用户名 demo - 镜像名
参考资料:
(六)构建Docker私有仓库、Gitlab仓库和持续集成环境
阿里云官方镜像站
https://developer.aliyun.com/mirror/
https://mirrors.aliyun.com/alpine/edge/main/
https://mirrors.aliyun.com/alpine/edge/community/