Should I Switch from Bind Mounts to Docker Volumes?
Asked by
CuriousCoder42
I'm currently managing around 50 containers and mainly use bind mounts for my data files. I'm curious if there's any advantage to switching to Docker volumes on the same disk instead. What do you think?
Answers
You might find more info in the official Docker documentation, which explains the differences between storage options. Here's a link for reference: docs.docker.com/engine/storage. However, that doesnโt dive deeply into the pros and cons of each option.
Reply to this answer
If bind mounts are already doing the job for you, there really isn't much benefit in changing things up.
Reply to this answer
It's really about your specific use cases. There aren't outright pros and cons between the two; they serve different needs. If your current setup with bind mounts is working well for you, there's no pressing reason to switch to Docker volumes.
Reply to this answer
Bind mounts come with their pros and cons. The big plus is that you have complete control over where the bind mount is located and how it works. You can easily check whatโs in a bind mount without needing to jump into the container. On the downside, management is all on you, which includes handling file permissions. Plus, if you're looking to connect to different types of storage like S3 or NFS, bind mounts can be tricky since Docker volumes have plugins that handle those connections.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions