登录Docker Hub

  1. [root@code1024 oFishClient]# docker login
  2. 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.
  3. Username: faury
  4. Password:
  5. WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
  6. Configure a credential helper to remove this warning. See
  7. https://docs.docker.com/engine/reference/commandline/login/#credentials-store
  8. Login Succeeded

重命名本地Image

按照Docker Hub要求重命名本地镜像:docker tag o-fish-client:0.1 faury/o-fish-client:0.1

  1. [root@code1024 oFishClient]# docker images
  2. REPOSITORY TAG IMAGE ID CREATED SIZE
  3. o-fish-client 0.1 74eba37e8344 16 minutes ago 896MB
  4. python 3.8.5 28a4c88cdbbf 2 weeks ago 882MB
  5. [root@code1024 oFishClient]# docker tag o-fish-client:0.1 faury/o-fish-client:0.1
  6. [root@code1024 oFishClient]# docker images
  7. REPOSITORY TAG IMAGE ID CREATED SIZE
  8. faury/o-fish-client 0.1 74eba37e8344 17 minutes ago 896MB
  9. o-fish-client 0.1 74eba37e8344 17 minutes ago 896MB
  10. python 3.8.5 28a4c88cdbbf 2 weeks ago 882MB

推送镜像

将本地镜像推送到Docker Hub仓库

  1. [root@code1024 oFishClient]# docker push faury/o-fish-client:0.1
  2. The push refers to repository [docker.io/faury/o-fish-client]
  3. 4341f6764f05: Pushed
  4. b72d580b28fe: Pushed
  5. 78ba56885b1a: Pushed
  6. dd275046203b: Mounted from library/python
  7. 48fd0662e424: Mounted from library/python
  8. 817923b47cba: Mounted from library/python
  9. 0fb2e27dc3b8: Mounted from library/python
  10. a995c5106335: Mounted from library/python
  11. 17bdf5e22660: Mounted from library/python
  12. d37096232ed8: Mounted from library/python
  13. 6add0d2b5482: Mounted from library/python
  14. 4ef54afed780: Mounted from library/python
  15. 0.1: digest: sha256:33dd2a6816156caa1d2f78180633b64d292568ed6ca6935c246b9a1c4f90e53f size: 2845

确认推送成功

到Docker Hub官网查看是否推送成功:https://hub.docker.com/repository/docker/faury/o-fish-client
image.png


至此,完成了Docker镜像的发布