Docker 将本地镜像推送到 Docker hub

Docker 将本地镜像推送到 Docker hub

  • docker hub 注册账号
  • 在docker hub上创建账号,create -》 create repository,例如:luwenbin8023/php
  • 运行 docker ps 查看运行的容器, 取得CONTAINER ID
luwb@MacBook-Pro ~ % docker ps
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                                                                                                          NAMES
3bd92c41d31c        luwenbin8023/php:7.4.12-fpm-alpine3.12   "docker-php-entrypoi…"   16 minutes ago      Up 16 minutes       9000/tcp, 0.0.0.0:9501-9502->9501-9502/tcp                                                                     php
  • commit 容器ID
luwb@MacBook-Pro ~ % docker commit 3bd92c41d31c luwenbin8023/php
sha256:174ffd6edfa64e00262e6a7b57e5e5afa7567fd9af7e0e3b998bb0fc9a9b86b6
  • Docker hub 登录
luwb@MacBook-Pro ~ % docker login
Authenticating with existing credentials...
Login Succeeded
  • 推送push镜像到你的Docker hub
luwb@MacBook-Pro ~ % docker push luwenbin8023/php:7.4.12-fpm-alpine3.12
The push refers to repository [docker.io/luwenbin8023/php]
2029c837aaab: Pushed
b22866b84e4b: Pushed
1339ecc2a594: Mounted from library/php
5a5477a9f9c7: Mounted from library/php
72a4304d7abc: Mounted from library/php
9d1e83c3583d: Pushed
524de70180f3: Mounted from library/php
2abb17e76a6a: Mounted from library/php
ea7d729a7e1b: Mounted from library/php
c84148fa85b6: Mounted from library/php
4f34707acc6f: Mounted from library/php
ace0eda3e3be: Pushed
7.4.12-fpm-alpine3.12: digest: sha256:d394be4b01fcfeb01bc4f8c3d7296daf42c9c8620e8b99eb149a5151826c12df size: 2830
  • Docker hub 查看上传的镜像
    在这里插入图片描述
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页