I am using docker compose (context: home server, OS is Manjaro Gnome) and use a service called FileRun as my filecloud. Filerun can be compared to Nextcloud. It supports webDAV.
The issue is that webDAV believes all my files have changed, when I reboot my server. This is caused by Docker giving a new device ID to a volume mount after restarting or rebooting.
This is confirmed by running stat
command within the container on the mounted volume:
before a reboot:
root@d0ec110775a0:/# stat /user-files
File: /user-files
Size: 120 Blocks: 0 IO Block: 4096 directory
Device: 2ah/42d Inode: 256 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 1000/ asterix) Gid: ( 1000/ asterix)
Access: 2022-10-12 09:48:42.281721759 +0000
Modify: 2022-10-12 09:48:42.281721759 +0000
Change: 2022-10-12 09:48:42.281721759 +0000
Birth: -
After a reboot:
root@d0ec110775a0:/# stat /user-files
File: /user-files
Size: 120 Blocks: 0 IO Block: 4096 directory
Device: 10002fh/1048623d Inode: 256 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 1000/ asterix) Gid: ( 1000/ asterix)
Access: 2022-10-12 09:48:42.281721759 +0000
Modify: 2022-10-12 09:48:42.281721759 +0000
Change: 2022-10-12 09:48:42.281721759 +0000
Birth: -
Notice the value for Device
has changed.
To solve this, I want to mount this volume with a fixed ID. This can be done via docker according to the manual: docker volume create | Docker Documentation
Example:
docker volume create --driver local \
--opt type=tmpfs \
--opt device=tmpfs \
--opt o=size=100m,uid=1000 \
--opt ID=2ah/42d \
foo
But how could I possibly do this via docker-compose syntax?
And I don’t want to set type, device, size etc just ID.
Currently, mounting just happens within the container section of my compose:
volumes:
- $DATAPOOL/users:/user-files