DockerHub
1.地址:https://hub.docker.com/
2.确定账号可以登录
3.在我们服务器上提交自己的镜像
[root@VM-16-11-centos test]# 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@VM-16-11-centos test]# docker login -u zbowen55
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.登录完毕后,可以提交镜像了,docker push
[root@VM-16-11-centos tomcat]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
zbowen55/mytomcat test ee3513bfc81a 24 minutes ago 686MB
diytomcat latest ee3513bfc81a 24 minutes ago 686MB
[root@VM-16-11-centos tomcat]# docker push zbowen55/mytomcat:test
The push refers to repository [docker.io/zbowen55/mytomcat]
1146a22c916c: Preparing
30706bbed908: Preparing
32f1e173dbed: Preparing
4736fd04b110: Pushing 2.56kB
2653d992f4ef: Preparing
#可以更改镜像标签
[root@VM-16-11-centos tomcat]# docker tag ee3513bfc81a zbowen55/mytomcat:1.0
[root@VM-16-11-centos tomcat]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
diytomcat latest ee3513bfc81a 27 minutes ago 686MB
zbowen55/mytomcat 1.0 ee3513bfc81a 27 minutes ago 686MB
阿里云镜像参考官方文档。