Reputation: 14529
This idea came to me and I don't know if it's viable.
Suppose you delete a bunch of files which happen to be mounted inside a docker container.
Because the container is still running, the files are held by the container, even if they're not visible to the host anymore.
As such, the process inside the container can still work with them. It's not untill the container is stopped/restarted, that they'll finally be gone.
What if you wanted those files back? You realize you made a mistake and you wish to bring those files back. Can the files, as seen from inside the container, be leveraged to this end in some way?
Upvotes: 0
Views: 201
Reputation: 59946
If you mount host directory with -v
flag if you delete files from month path from the host it will not show inside the container as well.
As such, the process inside the container can still work with them. It's not untill the container is stopped/restarted, that they'll finally be gone.
maybe the process in your case required all the required files on startup so, in that case, is fine, like you can delete nginx.conf but it will fail when it restart and it will only affect once you restart the process, so for such cases your assumption make sense but as per copying files does not make sense.
Upvotes: 1