How to list files in a stopped Docker container

前端 未结 6 1267
深忆病人
深忆病人 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:24

    If you want to see a certain file content, I would suggest using docker container cp command. Here is the doc. It works on stopped container. Example:

    docker container cp 02b1ef7de80a:/etc/nginx/conf.d/default.conf ./
    

    This way I got the config file that was generated by templating engine during start.

提交回复
热议问题