- 1.在docker hub 注册账号
- 2.docker login
- 3.push
- 4.成功
https://hub.docker.com
[root@localhost ~]# 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@localhost ~]# docker login -u shandian534
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.push
在这里插入代码片[root@localhost ~]# docker push datalink Using default tag: latest The push refers to repository [docker.io/library/shandian534] 0d215d96f063: Preparing 4623fdf578d8: Preparing 89354bde4414: Preparing 53930f9112e0: Preparing 74ddd0ec08fa: Preparing denied: requested access to the resource is denied #拒绝 #使用 docker tag 修改名称即可提交 #注意 修改tag的最前面必须是dockerhub的username 如: docker hub上的用户名/datalink:1.0 [root@localhost ~]# docker tag 630e6298d0a3 shandian534/datalink:1.0 [root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE datalink latest 630e6298d0a3 24 hours ago 677MB root755/diytomcat 1.0 630e6298d0a3 24 hours ago 677MB [root@localhost ~]# docker push shandian534/datalink:1.0 The push refers to repository [docker.io/shandian534/datalink] 0d215d96f063: Pushing [=====================> ] 28.1MB/64MB 4623fdf578d8: Pushing [==================================> ] 10.99MB/16.06MB4.成功



