Docker将自己的镜像发布到个人私有仓库

Docker将自己的镜像发布到个人私有仓库

1.注册dockerhub账户

docker提供了一个类似于github的仓库dockerhub,

网址https://hub.docker.com/需要注册使用

2.在服务器上登录账号

docker login

3.修改正确的镜像名

注意要保证image的tag是账户名,如果镜像名字不对,需要改一下tag

语法是: docker tag 仓库名 用户名/仓库名

docker tag zero/centos-vim 用户名/centos-vim

 

4.推送docker imagedockerhub

# docker push 用户名/镜像名

# docker push 用户名/centos-vim:latest

 

扫描二维码关注公众号,回复: 7327444 查看本文章

5.dockerhub中检查镜像

https://hub.docker.com/

6.删除本地镜像,测试下载pull 镜像文件

# 删除上传的镜像

#docker images

#docker rmi 用户名/centos-vim(即上传的镜像名)

docker pull 上传的镜像名

 

猜你喜欢

转载自www.cnblogs.com/hszstudypy/p/11565244.html