I have often found that volumes (that were mounted to a docker container) are empty or deleted from the host machine when I go back to look at them later.
This doesn't happen every time I stop a container, but seems to have happened at least a few times now. I assume that this is happening when the container crashes unexpectedly, EG. when the host machine loses power or something like that - I believe I read something about this being a commonish occurrence as well.
Is there a special way to mount a volume that prevents this behaviour from happening and ensures that my mounted volume will be safe, even if the container crashes?
Thanks