发布镜像到Docker Hub

发布镜像到Docker Hub

Docker Hub

1、地址https://hub.docker.com/,注册自己的账号

账号:xxx

2、确定这个账号可以登录

3、在服务器上提交镜像

[root@iZbp171s854seavehj9wvqZ ~]# 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
# -u 账号 -p 密码
[root@iZbp171s854seavehj9wvqZ ~]# docker login -u 账号 -p 密码
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
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、登录完毕就可以提交镜像,docker push命令

# 推送到自己的镜像服务器上!
[root@iZbp171s854seavehj9wvqZ ~]# docker push 镜像名称
Using default tag: latest
The push refers to repository [docker.io/library/jzytomcat]
920334bd67dd: Preparing 
5fb7c023055a: Preparing 
e2de95481e4a: Preparing 
e4cd2fee6b9f: Preparing 
174f56854903: Preparing 
denied: requested access to the resource is denied #拒绝
#无版本和推送用户信息的推送会被拒绝
#push镜像问题
[root@iZbp171s854seavehj9wvqZ ~]# docker push jzytomcatcc
Using default tag: latest
The push refers to repository [docker.io/library/jzytomcatcc]
An image does not exist locally with the tag: jzytomcatcc
#tag信息一定要先准备好

#添加tag信息和修改镜像名
[root@iZbp171s854seavehj9wvqZ ~]# docker tag c43cf5196ca3 xxx/tomcat:1.0

#docker push上去即可!发布的镜像尽量带上版本号
[root@iZbp171s854seavehj9wvqZ ~]# docker push xxx/tomcat:1.0
The push refers to repository [docker.io/xxx/tomcat]
920334bd67dd: Pushed 
5fb7c023055a: Pushed 
e2de95481e4a: Pushed 
e4cd2fee6b9f: Pushed 
174f56854903: Pushed 
1.0: digest: sha256:2c6d2a983d6acd6566f756616079aff9e800b94a41d31d44e6be3b960a69a399 size: 1373

在这里插入图片描述

在自己的docker hub账号上看到对应镜像就是完成
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值