1.查看镜像
| [root@centos201 ~]# docker image ls # 查看现有的镜像列表。 |
| REPOSITORY TAG IMAGE ID CREATED SIZE |
| hello-world latest feb5d9fea6a5 20 months ago 13.3kB |
| [root@centos201 ~]# |
| [root@centos201 ~]# |
| [root@centos201 ~]# docker image ls -q # 只查看镜像的id |
| feb5d9fea6a5 |
| [root@centos201 ~]# |
| [root@centos201 ~]# docker images # 等效于"docker image ls" |
| REPOSITORY TAG IMAGE ID CREATED SIZE |
| hello-world latest feb5d9fea6a5 20 months ago 13.3kB |
| [root@centos201 ~]# |
2.给镜像打标签
| [root@centos201 ~] |
| REPOSITORY TAG IMAGE ID CREATED SIZE |
| hello-world latest feb5d9fea6a5 20 months ago 13.3kB |
| [root@centos201 ~] |
| [root@centos201 ~] |
| [root@centos201 ~] |
| [root@centos201 ~] |
| REPOSITORY TAG IMAGE ID CREATED SIZE |
| hello-world latest feb5d9fea6a5 20 months ago 13.3kB |
| centos-hello-world v0.1 feb5d9fea6a5 20 months ago 13.3kB |
| [root@centos201 ~] |
3.本地镜像迁移
3.1.导出镜像到一个tar包的2种方式
| 导出镜像到一个tar包的2种方式: |
| [root@centos201 ~] |
| REPOSITORY TAG IMAGE ID CREATED SIZE |
| hello-world latest feb5d9fea6a5 20 months ago 13.3kB |
| test-hello-world v0.1 feb5d9fea6a5 20 months ago 13.3kB |
| [root@centos201 ~] |
| [root@centos201 ~] |
| [root@centos201 ~] |
| [root@centos201 ~] |
3.2.从一个tar包导入镜像的两种方式
| [21:24:47 root@centos202 ~] |
| |
| |
| root@ubuntu211:~ |
| root@ubuntu211:~ |
| root@ubuntu211:~ |
4.下载镜像
| [root@centos201 ~]# docker pull nginx:1.14.2 # 下载一个nginx版本号为1.14.2的镜像。 |
| |
| [root@centos201 ~]# docker pull mysql:8.0 # 下载一个mysql版本号为8.0的镜像。 |
| |
| [root@centos201 ~]# docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.5 # 去第三方镜像仓库下载镜像 |
| |
| [root@centos201 ~]# docker pull tomcat:9 # 下载一个tomcat9的镜像 |
5.删除镜像
| [root@centos201 ~] |
| |
| |
| root@ubuntu211:~ |
| |
| |
| [root@centos202 ~] |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)