列出退出容器中的文件 [英] List files in exited container
问题描述
是否有一种简单的方法来检查容器退出后生成了哪些文件?
Is there an easy way to check what files were produced after container exits?
我看到了重写 Dockerfile $ c $的建议c>并向其中添加
ls
命令,但这对我而言不是简单的方法。
I saw recommendations to rewrite Dockerfile
and add ls
commands to it, but that's not the easy way for me.
更新:我在 Dockerfile
和 docker diff $中使用了
VOLUME
指令c $ c>在那里没有显示更改。
UPDATE: I was using VOLUME
directive inside Dockerfile
and docker diff
doesn't show changes there.
推荐答案
您可以使用 docker diff container_name
。此检查容器文件系统上文件或目录的更改。
You can use docker diff container_name
. This inspect changes to files or directories on a container filesystem.
它显示类似这样的内容。
It shows something like this.
A /usr/local/lib/python2.7/email
C /usr/local/lib/python2.7/email/mime
D /usr/local/lib/python2.7/email/mime/audio.pyc
A
:已添加文件或目录
C
:文件或目录已更改
D
:文件或目录已删除
希望这很有帮助,祝你好运!
Hope this helps, good luck!
这篇关于列出退出容器中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!