Hey everyone! I have three standalone systems running Docker, with Portainer and its agent installed on each. Two of them are on openSUSE Tumbleweed (running Docker v.25.7.1-ce) and one is on my Synology NAS (v.24.0.2). I access Portainer through my Synology, which has agents on the Tumbleweed machines.
When I create a stack on my Synology and map a volume like `/var/lib/docker/volumes/myapp:/config`, it works perfectly and uses my local folder without creating a named volume. I have over 30 containers running there, and there are no volumes listed in the Portainer Volumes tab. But when I create the same stack on one of my Tumbleweed machines, it automatically adds a `/var/lib/docker/volumes/myapp/_data` volume for each volume I specify in the stack, which doesn't correspond to anything on the system. These are labeled as "unused" but deleting them causes issues.
I'm puzzled about why this behavior differs between systems; it seems that on the Synology, everything operates as expected without those extra volumes appearing. Also, it looks like the `_data` volumes are available to all containers, leading me to wonder if there's a setting that makes all mounts available to all volumes. Any insights would be greatly appreciated! Thanks!
2 Answers
It looks like you’re setting up a bind mount that connects to the Docker volumes folder directly. On your Synology, that’s treated differently as a direct bind mount, while on Tumbleweed, it creates a managed volume with the `_data` folders. Managed volumes help Docker handle the volume lifecycle better and might be why you see that extra `_data` volume. You could try configuring your Docker to use `volumes:` syntax without specifying the local path to see if that clears things up on Tumbleweed!
One likely reason for this issue is that a managed volume is created when Docker thinks it needs more structure. Since you’re using the local Docker folder directly on Tumbleweed, it interprets that as requiring a separate volume, thus generating the `_data`. If you want similar behavior to Synology, ensure you're using proper volume declarations in your Docker Compose files. Managed volumes allow for easier management and data preservation, so just be aware of that.
Great insight! I didn't even think about how managed volumes might function differently. I’ll adjust my setup accordingly and see if that helps with the inconsistency.
Exactly! It sounds like the Synology has some optimized settings that treat it differently. If you're consistently seeing the same behavior with other setups, it might just be their way of managing Docker volumes compared to how Docker handles it in openSUSE.