srirams Posted June 3, 2022 Share Posted June 3, 2022 Currently, I believe that unraid is using -v to mount paths in docker. This has the undesirable side effect of creating the path in the host system if it doesn't exist. So, for example, if you've use a bind mount in docker pointing to /mnt/disks/data and /mnt/disks/data does not exist, it will be created in the host system as an empty directory, leading to problems when you want to actually mount something into /mnt/disks/data. Using the --mount syntax instead will not auto create paths. See https://docs.docker.com/storage/bind-mounts/ for reference. Quote Differences between -v and --mount behavior Because the -v and --volume flags have been a part of Docker for a long time, their behavior cannot be changed. This means that there is one behavior that is different between -v and --mount. If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory. If you use --mount to bind-mount a file or directory that does not yet exist on the Docker host, Docker does not automatically create it for you, but generates an error. 1 Quote Link to comment
Squid Posted June 3, 2022 Share Posted June 3, 2022 Damned if you do, damned if you don't. Many required folders may need to be created depending upon the container - most notably, the appdata folder. Quote Link to comment
JonathanM Posted June 3, 2022 Share Posted June 3, 2022 Could we get an option in the config like there is for access mode? Quote Link to comment
srirams Posted June 3, 2022 Author Share Posted June 3, 2022 21 minutes ago, Squid said: Damned if you do, damned if you don't. Many required folders may need to be created depending upon the container - most notably, the appdata folder. I think unraid creating the folders when you add a new container is ok, but I don't see the use case for docker ever creating folders when you start a container (its gonna create an empty folder because the appdata folder is not mounted) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.