本文主要是介绍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 查看上传的镜像
这篇关于Docker 将本地镜像推送到 Docker hub的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!