docker-nfs-server icon indicating copy to clipboard operation
docker-nfs-server copied to clipboard

directory does not support NFS

Open strauss69400 opened this issue 4 years ago • 5 comments

Hi everyone,

I get this error when i run the container : Impossible to find the solution. i tried many things but without success

In the logs i get this informations:

  STARTING SERVICES ...

================================================================== ----> starting rpcbind ----> starting exportfs exportfs: /home does not support NFS export ----> ----> ERROR: /usr/sbin/exportfs failed ---->

and this is my docker-compose

nfs-server:
  image: erichough/nfs-server
  container_name: nfs-server
  hostname: project
  environment:
    NFS_PORT: 2049
    NFS_VERSION: 3
    #NFS_SERVER_THREAD_COUNT: 8
    NFS_EXPORT_0: /home *(rw,insecure,no_subtree_check,fsid=0,no_root_squash,sync)
  restart: unless-stopped
  volumes:
    - type: bind
      source: /etc
      target: /home
      read_only: false
  cap_add:
    - SYS_ADMIN
    - SYS_MODULE
  privileged: true
  ports:
    - 2049:2049
    - 112:112
    - 32765:32765
    - 32767:32767

Can you help me please ? Best regards

strauss69400 avatar Feb 23 '21 19:02 strauss69400

I'm seeing the same issue.

james-mchugh avatar Apr 23 '21 02:04 james-mchugh

same for me ...

finalspy avatar May 11 '21 15:05 finalspy

I found that the NFS share must be mounted to the host as well. So in your docker-compose.yml

volumes:
      - <directory that exist on host>:/home
      - type: bind
         source: /etc
         target: /home
         read_only: false

And this should get rid of the error.

aaron-pham avatar Aug 12 '21 17:08 aaron-pham

@aaron-pham Could you show an example with more details? (For example a full docker-compose.yml)

I have tried it like this:

version: "2.1"
services:
  nfs-server:
    image: erichough/nfs-server:2.2.1
    container_name: nfs-server
    privileged: true
    volumes:
      - /F/tusfiles:/home/user/share
      - type: bind
        source: /F/tusfiles
        target: /home/user/share
        read_only: false
      - /F/tusfiles/exports.txt:/etc/exports:ro  
    ports:
      - 2049:2049

But I got this error:

ERROR: Duplicate mount points: [/F/tusfiles:/home/user/share:rw, /F/tusfiles:/home/user/share:rw]

(I get the same error if the source is /etc)

bargergo avatar Sep 12 '21 14:09 bargergo

What if I don't want to have a bind mount to the host? Is there any way to share the folder without doing that?

mcclumpherty avatar Sep 22 '23 16:09 mcclumpherty