发布自己的镜像
Dockerhub
DockerHub
-
地址 https://hub.docker.com/ 注册自己的账号! -
确定这个账号可以登录 -
在我们服务器上提交自己的镜像 [root@aZang tomcatlogs]
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@aZang tomcatlogs]
[root@aZang ~]# docker login -u gdumping
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@aZang ~]#
-
登录完毕后就可以提交镜像了,就是一步docker push [root@aZang ~]
Using default tag: latest
The push refers to repository [docker.io/library/diytomcat]
0965604b9d91: Preparing
d7b64869e4d1: Preparing
1ea8689fad58: Preparing
9aae89a7c6b9: Preparing
2653d992f4ef: Preparing
denied: requested access to the resource is denied
[root@aZang ~]
The push refers to repository [docker.io/gdumping/diytomcat]
An image does not exist locally with the tag: gdumping/diytomcat
[root@aZang ~]
[root@aZang ~]
The push refers to repository [docker.io/gdumping/tomcat]
0965604b9d91: Pushing 1.664MB/60.68MB
d7b64869e4d1: Pushing 1.866MB/15.92MB
1ea8689fad58: Pushing 1.583MB/396.7MB
9aae89a7c6b9: Pushed
2653d992f4ef: Pushing 2.693MB/209.3MB
提交的时候也是按照镜像的层级来进行提交的!
阿里云
阿里云镜像服务上
-
登陆阿里云 -
找到容器镜像仓库 -
创建命名空 填写命名空间信息 -
创建镜像仓库 -
浏览阿里云
[root@aZang ~]
Removing login credentials for https://index.docker.io/v1/
[root@aZang ~]
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/
Login Succeeded
[root@aZang ~]
[root@aZang ~]
The push refers to repository [registry.cn-hangzou.aliyuncs.com/azang_test/azang_test_2021_08_24]
0965604b9d91: Pushing 30.29MB/60.68MB
d7b64869e4d1: Pushed
1ea8689fad58: Pushing 27.48MB/396.7MB
9aae89a7c6b9: Pushed
2653d992f4ef: Pushed
1.0: digest: sha256:f59f522806d6815eb651b4108dc6b0d8e2ed9e2382dddf6c9569459b7d5ef6d1 size: 1373
阿里云容器镜像就参考官方地址!
Docker其他学习笔记
Docker学习笔记(一)—安装启动hello world Docker学习笔记(二)—底层原理 Docker学习笔记(三)—常用命令 Docker学习笔记(四)练习—安装nginx Docker学习笔记(五)练习—安装tomcat Docker学习笔记(六)—可视化 Docker学习笔记(七)----镜像 Docker学习笔记(八)—数据容器卷 Docker学习笔记(九)—DockerFile Docker学习笔记(十)—发布自己的镜像
|