How to list files in a stopped Docker container

前端 未结 6 1269
深忆病人
深忆病人 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条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-03 21:13

    When starting the container is not an option, you can always export your image (a bit overkill but..) and list its contents:

    docker export -o dump.tar 
    
    tar -tvf dump.tar
    

    Reference: Baeldung - Exploring a Docker Container’s Filesystem

提交回复
热议问题