1、docker image inspect 简介
docker image inspect
是用于显示Docker镜像的详细信息,包括镜像的元数据、配置和挂载点等。
2、docker image inspect 语法
docker image inspect [OPTIONS] IMAGE [IMAGE...]
参考文档:https://docs.docker.com/engine/reference/commandline/image_inspect/
3、docker image inspect 命令
显示镜像的详细信息
docker image inspect myimage:1.0
输出:
[ { "Id": "sha256:f5f9a5cf7e735c5d6aa7a06ef10fb901f413a3f3a15d7dcce40ad4bfc7a8d048", "RepoTags": [ "myimage:1.0" ], "RepoDigests": [], "Parent": "", "Comment": "", "Created": "2021-07-14T08:44:59.00268969Z", "Container": "48f34211680eb2c2ff262bd3d02561903658712dd6807b2d3b6a3a6a9fb63133", "ContainerConfig": { "Hostname": "48f34211680e", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], "Cmd": [ "/bin/sh", "-c", "#(nop) ", "CMD [\"/bin/bash\"]" ], "Image": "", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": {} }, "DockerVersion": "19.03.13", "Author": "", "Config": { "Hostname": "", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": null, "Cmd": [ "/bin/bash" ], "Image": "", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": {} }, "Architecture": "amd64", "Os": "linux", "Size": 0, "VirtualSize": 256838430 } ]
4、命令选项
简称 | 默认值 | 描述 |
--format , -f | 使用自定义模板格式化输出: ‘json’: 以json格式打印 ‘TEMPLATE’: 使用给定的Go模板打印输出。 有关使用模板格式化输出的更多信息, |
5、子命令
命令 | 描述 |
docker image build | 从Dockerfile构建镜像 |
docker image history | 显示图像的历史 |
docker image import | 从压缩包中导入内容以创建文件系统映像 |
docker image inspect | 显示一个或多个镜像的详细信息 |
docker image load | 从tar存档文件或STDIN加载镜像 |
docker image ls | 镜像列表 |
docker image prune | 移除未使用的镜像 |
docker image pull | 从registry下载镜像 |
docker image push | 上传镜像到registry |
docker image rm | 删除一个或多个镜像 |
docker image save | 保存一个或多个镜像到tar存档(默认流式到STDOUT) |
docker image tag | 创建一个指向SOURCE_IMAGE的TARGET_IMAGE标签 |