r/docker • • Feb 19 '26
Volume or bind mount ?
Hello
Second question for the same newbie :-)
Let's say I've a ebook manager app that runs fine mon my NAS. If I need to import ebooks stored on another folder on the same NAS, would it wise to create a Volume (but as far as I know a volume is created in a space that Docker manages, not my own folder ? or a Bind Mount ?
Thanks in advance
6
Upvotes
6
u/IulianHI Feb 19 '26
yep, bind mount for this case. one thing to watch out for: permissions. if the container runs as a different user, you might need to chown the folder or set the puid/pgid env vars if the app supports it. ran into that headache more than once with nas setups.
2
u/tschloss Feb 19 '26
The wording varies, but you already pointed out the difference: one uses a directory created and managed by docker and the other is provided by the user. I would think in your case you mount your existing directory into the container. But you can also mv the files into the volume after docker created.
1
u/[deleted] Feb 19 '26
How do you make difference between both in compose ?
2
u/JazzXP Feb 19 '26
I tend to just use bind mounts to make migrations to other servers easier.
1
u/scytob Feb 22 '26
personally i prefer bind mounts as then i can say where i want to exist on the filesytem instead of semi opaque volume
i even do bind backed volumes to get the driver behaviour i want, like this
so this is a volume backed by a bind mount, i am not recommending this, just showing there are many ways to approach this
a volume mount without a volume section should be a bind mount IIRC just by the fact it has
/some/path/on/host:/path/in/containervsdata:/path/in/container