docker-nfs-server
docker-nfs-server copied to clipboard
directory does not support NFS
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
I'm seeing the same issue.
same for me ...
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 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
)
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?