在DockerHub上创建账号:https://hub.docker.com/
这里我的账号是firewarm
本地下载镜像(这里拿alpine做示例),并为镜像打tag
[root@host-30 ~]# docker pull alpine:3.4
[root@host-30 ~]# docker tag alpine:3.4 firewarm/alpine:3.4
登录到DockerHub上
[root@host-30 ~]# docker login
# 输入用户名和密码
push镜像到DockerHub上
[root@host-30 ~]# docker push firewarm/alpine:3.4
The push refers to a repository [docker.io/firewarm/alpine]
4fe15f8d0ae6: Pushed
3.4: digest: sha256:dc89ce8401da81f24f7ba3f0ab2914ed9013608bdba0b7e7e5d964817067dc06 size: 528
————————————————