Score:1

Mapping NFS mount with docker: "Error response from daemon: error while creating mount source path"

jp flag

I'm trying to run a docker that gets its data from an NFS mount, something in the trend of:

docker -v /mnt/nfs1:/input ...

but I'm getting errors like:

docker: Error response from daemon: error while creating mount source path '/mnt/nfs1/input/large_files/quickstart-output': mkdir /mnt/nfs1/input: permission denied.

The NFS mount point is mounted as a non-root user and has root-squash set on the server config. I can't change this.

Also adding --user 12345 has had no effect.

Also trying to mount the NFS as that user from within the docker didn't work probably because the IP wasn't the same as the allowed one (?)

Can anybody let me know if it's possible and if so, how I can fix this. Thanks!

Score:0
jp flag

Looks like I solved it.. something along the lines of:

docker volume create --driver local --opt type=nfs \
  --opt o=addr=nfs.server.com,ro --opt device=:/complete/path nfs_input
    
docker volume create --driver local --opt type=nfs \
  --opt o=addr=nfs.server.com,rw --opt device=:/other/complete/path nfs_output
    
docker run \
  --user 12345:12345 \
  --mount source=nfs_input,target=/input \
  --mount source=nfs_output,target=/output \
  my_docker_image ....
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.