How to list files in a stopped Docker container

前端 未结 6 1284
深忆病人
深忆病人 2021-02-03 20:25

This question shows how to copy files out of a stopped container. This requires that I know the full path to the file including its file name. I know the directory I want to c

6条回答
  •  旧时难觅i
    2021-02-03 21:03

    The command docker diff *CONTAINER* will list the files added, deleted and changed since the Container started.

    If a file did not change since the container was started, then you would have to know the contents of the original image that started the container. So, this answer is not ideal but avoids creating an image and running it.

    Unlike container-diff, this command does not require first creating a Docker image.

提交回复
热议问题