震惊!docker镜像还有这些知识,你都知道吗?----镜像(一)

镜像操作命令表格

docker image 子命令 docker子命令 功能
docker image build docker build 从Dockerfile开始构建镜像
docker image history docker history 显示镜像的历史记录
docker image import docker import 从tarball文件导入内容以创建文件系统镜像
docker image inspect docker ispect 显示一个或多个镜像文件的详细信息
docker image load docker load 从tar档案文件或者STDIN装载镜像
docker image ls docker images 输出镜像列表
docker image prune 删除未使用的镜像
docker image pull docker pull 从注册服务器拉取镜像或镜像仓库
docker image push docker push 将镜像或者镜像仓库推送到注册服务器
docker image rm docker rmi 删除一个或者多个镜像
docker image save docker save 将一个或者多个镜像保存在tar存档(默认情况下流式传输到STDOUT)
docker image tag docker tag 为指向源镜像的目标镜像添加一个名称

docker镜像拉取

[root@hmm ~] docker pull ubuntu:14.04

docker镜像查看

  • docker images
  • docker image ls
[root@hmm ~] docker images
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
ubuntu        latest    3db8720ecbf5   3 weeks ago     77.9MB
ubuntu        18.04     f9a80a55f492   9 months ago    63.2MB
hello-world   latest    d2c94e258dcb   10 months ago   13.3kB
ubuntu        14.04     13b66b487594   2 years ago     197MB
[root@hmm ~]# docker image ls
REPOSITORY    TAG       IMAGE ID       CREATED         SIZE
ubuntu        latest    3db8720ecbf5   3 weeks ago     77.9MB
ubuntu        18.04     f9a80a55f492   9 months ago    63.2MB
hello-world   latest    d2c94e258dcb   10 months ago   13.3kB
ubuntu        14.04     13b66b487594   2 years ago     197M

其他

[root@hmm ~]docker images -h

Usage:  docker images [OPTIONS] [REPOSITORY[:TAG]]     # 使用语法

List images    

Aliases:   # 关联的命令

  docker image ls, docker image list, docker images     # 这三个命令效果等效



Options:

  -a, --all             Show all images (default hides intermediate images)

               # 显示所有镜像(默认会隐藏中间镜像)

      --digests         Show digests     # 显示镜像摘要值

  -f, --filter filter   Filter output based on conditions provided    # 筛选镜像

      --format string   Format output using a custom template:    # 格式化输出

                        'table':            Print output in table format

                        with column headers (default)

                        'table TEMPLATE':   Print output in table format

                        using the given Go template

                        'json':             Print in JSON format

                        'TEMPLATE':         Print output using the given

                        Go template.

                        Refer to https://docs.docker.com/go/formatting/

                        for more information about formatting output with

                        templates

      --no-trunc        Don't truncate output     # 不截断输出

  -q, --quiet           Only show image IDs        # 只显示镜像ID

posted on   代码你敲我不敲  阅读(35)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具

导航

统计

返回顶端
点击右上角即可分享
微信分享提示