ehough / docker-nfs-server

A lightweight, robust, flexible, and containerized NFS server.
https://hub.docker.com/r/erichough/nfs-server/
GNU General Public License v3.0
669 stars 221 forks source link

Creating own Image from Dockerfile wont work #66

Closed Ujkugri closed 3 years ago

Ujkugri commented 3 years ago

Hi,

I build your Dockerfile with the command

docker build --rm --no-cache -t nfs-server /location/of/Dockerfile

and after that I tried

docker run -it \
 -v /tmp:/var/nfs \
 -v /root/docker-nfs-server/exports.txt:/etc/exports:ro \
 -v /lib/modules:/lib/modules:ro \
 --cap-add SYS_MODULE \
 --cap-add SYS_ADMIN \
 -p 2049:2049   -p 2049:2049/udp   \
 -p 111:111     -p 111:111/udp     \
 -p 32765:32765 -p 32765:32765/udp \
 -p 32767:32767 -p 32767:32767/udp \
 nfs-server

But it gets me this error:

==================================================================
      SETTING UP ...
==================================================================
---->
----> ERROR: missing CAP_SYS_ADMIN. be sure to run this image with --cap-add SYS_ADMIN or --privileged
---->

Is there something I am missing when building your Image? Because if I use your Image, in other Words the Image erichough/nfs-server everything works fine. Problem is, that I need to modify the Dockerfile, so I cant just use your image ....

Hope you can help me

xZero707 commented 3 years ago

@GentianRrafshi I have submitted the pull request (#67) that fixes this. If you want it working in meanwhile, you can check out my fork xZero707/docker-nfs-server

Ujkugri commented 3 years ago

That worked. In my point of view, after the pull this issue can be closed.

xZero707 commented 3 years ago

Glad that this worked for you. I think the issue should remain open until my pull request is merged.