登录Docker Hub
[root@code1024 oFishClient]# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: faury
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
重命名本地Image
按照Docker Hub要求重命名本地镜像:docker tag o-fish-client:0.1 faury/o-fish-client:0.1
[root@code1024 oFishClient]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
o-fish-client 0.1 74eba37e8344 16 minutes ago 896MB
python 3.8.5 28a4c88cdbbf 2 weeks ago 882MB
[root@code1024 oFishClient]# docker tag o-fish-client:0.1 faury/o-fish-client:0.1
[root@code1024 oFishClient]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
faury/o-fish-client 0.1 74eba37e8344 17 minutes ago 896MB
o-fish-client 0.1 74eba37e8344 17 minutes ago 896MB
python 3.8.5 28a4c88cdbbf 2 weeks ago 882MB
推送镜像
将本地镜像推送到Docker Hub仓库
[root@code1024 oFishClient]# docker push faury/o-fish-client:0.1
The push refers to repository [docker.io/faury/o-fish-client]
4341f6764f05: Pushed
b72d580b28fe: Pushed
78ba56885b1a: Pushed
dd275046203b: Mounted from library/python
48fd0662e424: Mounted from library/python
817923b47cba: Mounted from library/python
0fb2e27dc3b8: Mounted from library/python
a995c5106335: Mounted from library/python
17bdf5e22660: Mounted from library/python
d37096232ed8: Mounted from library/python
6add0d2b5482: Mounted from library/python
4ef54afed780: Mounted from library/python
0.1: digest: sha256:33dd2a6816156caa1d2f78180633b64d292568ed6ca6935c246b9a1c4f90e53f size: 2845
确认推送成功
到Docker Hub官网查看是否推送成功:https://hub.docker.com/repository/docker/faury/o-fish-client
至此,完成了Docker镜像的发布