11发布自己的镜像(阿里云)

目录

发布自己的镜像

一、Dockerhub

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

2.确定账号可以登录

3.在我们服务器上提交自己的镜像

4.登陆完毕后就可以提交镜像

5.docker push 

二、阿里云镜像服务上

1.登录阿里云

2.找到容器镜像服务

3.创建命名空间

4.创建容器仓库​

5.浏览信息​

镜像上传 

登录 

修改发布镜像的版本 

上传 

下载


发布自己的镜像

一、Dockerhub

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

2.确定账号可以登录

3.在我们服务器上提交自己的镜像

 [root@centos01 gh]# 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@centos01 gh]# 

4.登陆完毕后就可以提交镜像

[root@centos01 gh]# docker login -u 2495140780
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

5.docker push 

#push到自己的服务器上
[root@centos01 gh]# docker push gh/jdk/tomcat
Using default tag: latest
The push refers to repository [docker.io/gh/jdk/tomcat]
ec168676a560: Preparing 
c7679ce1f2ce: Preparing 
0b961db77ed3: Preparing 
9c131fac41e6: Preparing 
74ddd0ec08fa: Preparing 
denied: requested access to the resource is denied  #拒绝
[root@centos01 gh]# 

#解决,增加一个 tag
[root@centos01 gh]# docker tag 1a136bef8b49 gh/jdk/tomcat:1.0

#docker push山去即可! 自己发布的镜像尽量戴上版本号
[root@centos01 gh]# docker push gh/jdk/tomcat:1.0 
The push refers to repository [docker.io/gh/jdk/tomcat]
ec168676a560: Preparing 
c7679ce1f2ce: Preparing 
0b961db77ed3: Preparing 
9c131fac41e6: Preparing 
74ddd0ec08fa: Preparing 

二、阿里云镜像服务上

1.登录阿里云

2.找到容器镜像服务

3.创建命名空间

4.创建容器仓库

5.浏览信息

镜像上传 

登录 

# 登录成功
[root@gh dockerfile]# docker login --username=xxxxxxregistry.cn-qingdao.aliyuncs.com
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
[root@gh dockerfile]# 

修改发布镜像的版本 

[root@gh java]# docker tag 20b770574f05 registry.cn-hangzhou.aliyuncs.com/gongdada/diytocmat:1.1

[root@gh java]# docker images
REPOSITORY      TAG       IMAGE ID       CREATED             SIZE
mytomcat        1.1       20b770574f05   27 minutes ago      801MB
diytomcat       1.1       20b770574f05   27 minutes ago      801MB

上传 

[root@gh java]# docker push registry.cn-hangzhou.aliyuncs.com/gongdada/diytocmat:1.1
The push refers to repository [registry.cn-hangzhou.aliyuncs.com/gongdada/diytocmat]
00cc4c934513: Pushing [==>                                                ]  10.87MB/215.6MB
72df085a27ae: Pushing [==============>                                    ]  4.688MB/16MB
99df646bb573: Pushing [>                                                  ]  4.422MB/365.3MB
ba971dbd4971: Pushed 
174f56854903: Pushing [==>                                                ]  9.779MB/203.9MB
1.1: digest: sha256:64a0c2aee5f32aba5c3c258e0a350e17ad440c7cb543047ddd7eac7ce8f0dbf8 size: 1373

下载

[root@gh dockerfile]# docker pull registry.cn-hangzhou.aliyuncs.com/gongdada/diytocmat:1.1
1.1: Pulling from gongdada/gh1234
5e0b432e8ba9: Pull complete 
a84cfd68b5ce: Pull complete 
e8b8f2315954: Pull complete 
0598fa43a7e7: Pull complete 
e0d35e3be804: Pull complete 
8fc448a0c88b: Pull complete 
dbdff6e5955b: Pull complete 
5daf3771e3d8: Pull complete 
e4265b3badfc: Pull complete 
126f233cb97a: Pull complete 
25b2696affa4: Pull complete 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

gh-xiaohe

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

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

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

打赏作者

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

抵扣说明:

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

余额充值