如何查看Docker映像内容 [英] How to see docker image contents
本文介绍了如何查看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
或者跟随具有入口点$ c $的图像c>
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
文件。
这篇关于如何查看Docker映像内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文