Docker:发布镜像到DockerHub

本文主要围绕如何发布镜像到Docker Hub上,成为开源的镜像

步骤:

1、地址:Docker Hub ,先注册账号

2、保证账号可以正常登录

 

3、在服务器上提交镜像

 # 查看登录命令帮助信息
 [root@localhost opt]# docker login --help
 ​
 Usage:  docker login [OPTIONS] [SERVER]
 ​
 Log in to a Docker registry.
 If no server is specified, the default is defined by the daemon.
 ​
 Options:
   -p, --password string   Password
       --password-stdin    Take the password from stdin
   -u, --username string   Username
   
   
 # 登录成功
 [root@localhost opt]# docker login -u foolishbird69
 Password: 
 WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
 Configure a credential helper to remove this warning. See
 https://docs.docker.com/engine/reference/commandline/login/#credentials-store
 ​
 Login Succeeded  

4、提交镜像到DockerHub

 #            用户名  /  镜像名  版本号
 docker push userName/imageName:tag

 

常见错误

1). An image does not exist locally with the tag : userName/imageName

原因:本地镜像不存在具体版本号

解决: 给镜像添加tag

2). denied: requested access to the resource is denied

原因:push时不带版本号     解决:添加版本号再push

 原因:push的格式错误       解决:改为用户名

5、查看发布结果,发布成功

 

====================================================================

到此为止,我们就完成了开源自己的镜像到Docker Hub上,别人就可以下载下来使用了。

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

To Do.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值