docker(二)共有仓库及私有仓库的使用

1.共有仓库

先去https://hub.docker.com申请一个账号,我这里的用户名为q975583865,以此为例

 

docker pull redis

docker tag redis q975583865/test1:latest

 

docker login

docker push q975583865/test1:latest

1~2分钟之后去https://hub.docker.com/repositories查看是否上传成功

 

2.私有仓库

docker pull registry

docker run -d -v /opt/registry:/var/lib/registry -p 5000:5000 --restart=always --name registry registry:latest

docker tag redis 127.0.0.1:5000/test1:latest
docker push 127.0.0.1:5000/test1:latest

 

curl 127.0.0.1:5000/v2/_catalog

 

删除本地,从私有库拉
docker rmi 127.0.0.1:5000/test1

docker pull 127.0.0.1:5000/test1

 

docker(二)共有仓库及私有仓库的使用

 

docker(二)共有仓库及私有仓库的使用