Docker Community Forums

Share and learn in the Docker community.

FUSE volumes and clean up (-rm) option in Docker, how this works?


(Reynierpm) #1

I am learning Docker and I have a doubt about how it works regarding FUSE volumes and clean up(-rm) option used in examples from docs. So, docs said for mount a FUSE volume we should use the command below:

$ docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse sshfs sshfs ven@ /mnt

Then in docs for Clean up (-rm) it says:

Note: When you set the --rm flag, Docker also removes the volumes
associated with the container when the container is removed. This is
similar to running docker rm -v my-container. Only volumes that are
specified without a name are removed. For example, with docker run
–rm -v /foo -v awesome:/bar busybox top, the volume for /foo will be removed, but the volume for /bar will not. Volumes inherited via
–volumes-from will be removed with the same logic – if the original volume was specified with a name it will not be removed.

Will -rm option passed clean up the remote SSHFS folder each time the container is started (run)? If this is correct, can I get rid of the -rm option? I don’t want to loose all the content of the remote SSHFS shared folder