如何查看docker镜像内容 [英] How to see docker image contents

查看:126
本文介绍了如何查看docker镜像内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个 docker pull 并且可以列出下载的图像.我想看看这张图片的内容.在网上搜索了但没有直接答案.

I did a docker pull and can list the image that's downloaded. I want to see the contents of this image. Did a search on the net but no straight answer.

推荐答案

您可以使用该图像运行交互式 shell 容器并探索该图像具有的任何内容.

You can just run an interactive shell container using that image and explore whatever content that image has.

例如:

docker run -it image_name sh

或者关注带有 entrypoint

docker run -it --entrypoint sh image_name

或者,如果您想查看映像的构建方式,即其 Dockerfile 中的步骤,您可以:

Or, if you want to see how the image was build, meaning the steps in its Dockerfile, you can:

docker image history --no-trunc image_name > image_history

这些步骤将被记录到 image_history 文件中.

The steps will be logged into the image_history file.

这篇关于如何查看docker镜像内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆