Compose file and volumes on nfs mount

I have a machine with a small hard drive and I want to try out some docker compose files to run some services. So, I thought that I would mount an NFS share from a larger machine where the docker compose files and data directories would sit.

Then in the smaller machine I created a directory /mnt/docker/portainer and inside this directory I put the portainer docker-compose.yaml and a “data” directory. When I do a “docker compose up -d” I get:

open /mnt/docker/portainer/docker-compose.yaml: permission denied

I have tried this as root and as my user. I also tried as a CIFS mount too.

So, why will docker compose not seem to run a docker-compose.yaml file that is sitting on a mounted file system?


So, I mounted the directory to /home/<username>/docker rather than /mnt/docker and I was able to do the docker compose in there. So… it works now, just not sure why I could not run docker compose in /mnt rather than /home.