发布自己的镜像
1.地址 注册自己的账号;Docker Hubhttps://hub.docker.com/ 2.确定这个账号可以登录;
[root@liustudy tomcat]# docker login -u liusirstudy
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
3.在我们服务器上提交;
[root@liustudy tomcat]# 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
4. 登录完毕后就可以提交镜像了,就是一步 docker push
[root@liustudy tomcat]# docker push diytomcat
Using default tag: latest
The push refers to repository [docker.io/library/diytomcat]
c16e447c4c27: Preparing
b484f02e73f9: Preparing
ba873286a549: Preparing
839f318099b7: Preparing
174f56854903: Preparing
#push镜像问题?
[root@liustudy tomcat]# docker push liusirstudy/diytomcat:1.0
The push refers to repository [docker.io/liusirstudy/diytomcat]
An image does not exist locally with the tag: liusirstudy/diytomcat
解决:增加一个 tag
提交的时候也是按照镜像的层级来提交的。
ps:这里需要注意,docker push 仓库名/镜像:tag; 仓库名为账号名,才可以成功上传。
提交的时候也是按照镜像的层级进行提交的!
发布镜像到阿里云服务上
1. 登录阿里云
2. 找到容器镜像服务
3. 创建命名空间
ps:只有三次免费创建的机会,创建需谨慎!
4. 创建容器镜像
5.浏览阿里云
push 不上服务器问题http://t.csdn.cn/kIn0h
小结: