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

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.

  • Can't access to docker mongo without being root
  • local files missing from docker-machine container
  • Setting $PATH in docker image?
  • Fallback for environment variables with docker-compose
  • Not getting the IP address of the docker container from node.js code when run the container with port forwarding
  • how does Flocker implement image migration while doing container migration between hosts
  • Switching app versions with docker container
  • Can't import own python module in Postgresql plpython function
  • Docker - failed to connect to running image
  • Docker. Error: Cannot start container: port has already been allocated
  • When using docker-compose to fire up containers how do I programatically get their ips?
  • Docker Ubuntu 12.04
  • One Solution collect form web for “How to remove file/folder from Docker container without starting this container”

    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 ?

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.