Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove file/folder from Docker container without starting this container

Tags:

docker

How to remove file/folder from Docker container without starting this container? "Docker exec containerID rm filePath" can do it but it requires container in start state.

like image 286
Jacky Chen Avatar asked Oct 18 '22 17:10

Jacky Chen


1 Answers

The only other way I can find is to create a Dockerfile and put a RUN rm /path/file/you/want/to/rm into it...

Why want you to remove a file or a path without starting your container ?

like image 80
Thibault Loison Avatar answered Oct 20 '22 23:10

Thibault Loison