Docker Volumes or Bind Mounts?

Good afternoon everyone,

I have been working with Docker on Debian for some time now. (coming from a Synology NAS) I have now created a few containers with Docker volumes, as I have read that there are many advantages, such as automatic rights assignment, which Docker takes care of. More isolation from the host system, etc.

In general, I find it confusing when researching applications, as sometimes it says that a UID should be authorized, but sometimes it says it shouldn’t. That’s why I’m a little wary of bind mounts.

However, when it comes to backups, bind mounts seem more convenient to me because I don’t need a container where I map all volumes, but simply stop the containers and then back up all data under the bind mount, which should provide a consistent backup even for databases, since the containers are stopped. Or am I wrong? It is often recommended to do a dump for databases.

But how can I check which permissions are required? I don’t want to create the container and then realize later that something is wrong. Or would that be immediately apparent?

I use Portainer and Stacks, i.e., Docker Compose.

I was thinking of using a directory such as /opt/docker/Containername. Does that make sense?

Is it consistent to stop all Docker containers and back up the volumes under /var/lib/docker/volumes with rsync or another program?

Here are a few containers that I would like to run. Perhaps someone can comment on the rights/permissions that need to be set and how they behave with bind mounts?

-ngnix proxy manager

-sftpgo (I have explicitly read that uid 1000 must be authorized for bind mounts)

-linkwarden

-paperlessngnx

-audiobookshelf

-jellyfin

-portainer

I welcome any opinions/experiences/help.

Best regards and have a nice weekend :slight_smile:

Translated with DeepL.com (free version)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.