登录Docker Hub
[root@code1024 oFishClient]# docker loginLogin 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: fauryPassword:WARNING! Your password will be stored unencrypted in /root/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded
重命名本地Image
按照Docker Hub要求重命名本地镜像:docker tag o-fish-client:0.1 faury/o-fish-client:0.1
[root@code1024 oFishClient]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEo-fish-client 0.1 74eba37e8344 16 minutes ago 896MBpython 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 imagesREPOSITORY TAG IMAGE ID CREATED SIZEfaury/o-fish-client 0.1 74eba37e8344 17 minutes ago 896MBo-fish-client 0.1 74eba37e8344 17 minutes ago 896MBpython 3.8.5 28a4c88cdbbf 2 weeks ago 882MB
推送镜像
将本地镜像推送到Docker Hub仓库
[root@code1024 oFishClient]# docker push faury/o-fish-client:0.1The push refers to repository [docker.io/faury/o-fish-client]4341f6764f05: Pushedb72d580b28fe: Pushed78ba56885b1a: Pusheddd275046203b: Mounted from library/python48fd0662e424: Mounted from library/python817923b47cba: Mounted from library/python0fb2e27dc3b8: Mounted from library/pythona995c5106335: Mounted from library/python17bdf5e22660: Mounted from library/pythond37096232ed8: Mounted from library/python6add0d2b5482: Mounted from library/python4ef54afed780: Mounted from library/python0.1: digest: sha256:33dd2a6816156caa1d2f78180633b64d292568ed6ca6935c246b9a1c4f90e53f size: 2845
确认推送成功
到Docker Hub官网查看是否推送成功:https://hub.docker.com/repository/docker/faury/o-fish-client
至此,完成了Docker镜像的发布
