0

I have a NFS server that export a file-system.

showmount -e nfsserver
Export list for nfsserver:
/opt/application/aghas0/docker client1,client2

on the client2 server I have mounted the file-system from the nfsserver and that worked.

nfsserver:/opt/application/aghas0/docker  9.8G   23M  9.2G   1% /opt/application/aghas0/docker

so I tried to create a NFS Docker Volume named nfsvol

docker volume inspect nfsvol
[
    {
        "CreatedAt": "2019-07-16T16:31:47+02:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/nfsvol/_data",
        "Name": "nfsvol",
        "Options": {
            "device": ":/opt/application/aghas0/docker",
            "o": "addr=nfsserver_Ip,rw",
            "type": "nfs"
        },
        "Scope": "local"
    }
]

but when I try to mount this volume to a container I get the error bellow:

docker run -it -v nfsvol:/mnt alpine sh
docker: Error response from daemon: error while mounting volume with options: type='nfs' device=':/opt/application/aghas0/docker' o='addr=10.118.120.46,rw': input/output error.

I am using NFS4. I don't know if there is a specific configuration for this version. Does any one know how to fix this please ?

  • I am getting confused as to what is what. Is it a client, is it a server? – ctrl-alt-delor Jul 17 '19 at 8:40
  • Can you include Dockerfile – ctrl-alt-delor Jul 17 '19 at 8:44
  • I created the docker volume on the client server and started a basic alpine image – zeO_340 Jul 17 '19 at 9:42
  • client server = server that mount the filesystem shared by the nfs server. nfsvol is a docker volume created on the client server – zeO_340 Jul 17 '19 at 12:56
  • yep... that is just semantics, I don't believe that change the problem understanding. I have to rhel server that are client to my nfs server... English isn't my first language so I try my best to be clear... sorry if it wasn't the case for you – zeO_340 Jul 22 '19 at 8:37
0

Found the problem.

I had to pass as an option the nfs version used, when I create the docker volume,like this :

docker volume create --driver local --opt type=nfs --opt o=addr=nfsserver_IP,rw,vers=4 --opt device=:/opt/application/aghas0/ansible nfsvol

this has solved my problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.