Nfs-kernel-server service status is showing as 'nfsd not running' in docker

I have started the docker container with --privileged mode and installed the nfs-kernal-server inside docker container. nfsd daemon status is showing as not started even after sudo service nfs-kernel-server restart command.

below is output of service restart and status:
(python39_virtualenv) hitesh@my-docker: sudo service nfs-kernel-server restart

  • Stopping NFS kernel daemon [ OK ]
  • Unexporting directories for NFS kernel daemon… [ OK ]
  • Exporting directories for NFS kernel daemon… [ OK ]
  • Starting NFS kernel daemon [ OK ]

(python39_virtualenv) hitesh@my-docker: sudo service nfs-kernel-server status
nfsd not running

Expected behavior: nfsd status should be running if service restart success as shown in above restart command.

Please correct me if this is not correct way to start NFS server inside docker container which is started with --privileged mode.

Hi
I have exactly the same problem as you.
I’ve tried to make a ubuntu docker for nfs-mount but each time I got this log when I use the “service nfs-kernel-server” command.
please help me :((( I couldn’t solve it for about 4 days.
In addition, I can use and connect to another computer with nfs without docker and also with itsthenetwork/nfs-server-alpine:12 docker image.
Furthermore I create my docker with this below command:
sudo docker run -it --name ub -p 2049:2049 -p 8080:8080 -v /var/nfs/general:/data ubuntu
and container /etc/exports :
/data *(rw,sync,no_subtree_check,nohide)

Please help me :frowning: