Docker Community Forums

Share and learn in the Docker community.

Volumes on NFS-Share



Hi all

Docker ver: 18.06.1-ce
Host: CentOS 7.5

I run the Nextcloud app in a Docker Container on my little Cloud platform.
I presume that over some time the bundled MariaDB will get quite big … and therfore I want to store the DB-Files on a mounted NFS-share.

Now I’m facing the problem that I need to move the Volume:
“db:/var/lib/mysql” to “/data/nextcloud/db:/var/lib/mysql”

The MariaDB Container starts but get stuck at: “initializing DB”. A quick check revels that the directory the volume is pointing to is missing several sub-directories and files.

I use the following cmd to run the container:

docker run -d --name=nc-db -v /data/nextcloud/db:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=XXX -e MYSQL_PASSWORD=YYY -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud --network=nc-network mariadb

When I had the named-volume at “db” all files/dirs were present. Now using the bind-mount: “/data/nextcloud/db” only one sub-dir and a few files get created but the rest is missing.

It’s not a permission issue. I’m able to login to the container, goto /var/lib/mysql and mkdir/touch without problems.

Any ideas on how to make this work ?