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
672 stars 221 forks source link

Does this support ubuntu? #21

Closed atline closed 5 years ago

atline commented 5 years ago

I google the web & try other solution, seems all ubuntu container solution cannot work, and someone told me "nfs-kernel-server" was a kernel module, so nfs server cannot work in container.

But your solution seems make the nfs server start in container, so my question is: is it possible your solution works on ubuntu conatainer?

ehough commented 5 years ago

someone told me "nfs-kernel-server" was a kernel module, so nfs server cannot work in container.

This person is not correct :)

is it possible your solution works on ubuntu conatainer?

If you have an Ubuntu machine (or any Linux system) with Docker installed, you should be able to run this image and start and NFS server without any trouble. The image itself is based on Alpine Linux, but that's just an implementation detail.

Does that answer your question? Closing the issue but please feel free to continue the discussion and ask more questions!

atline commented 5 years ago

@ehough Appreciate for you response.

When I mean ubuntu, I just mean the container was based on ubuntu:

FROM ubuntu

Your solution is directly call with "readonly PATH_BIN_NFSD='/usr/sbin/rpc.nfsd'"

But in ubuntu or others, maybe service nfs-kernel-server start or with systemctl start.

I guess this will depend on some other service not sure, as you also did rpcbind, and also next:

rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs defaults nfsd /proc/fs/nfsd nfsd defaults

I'm not sure service nfs-kernel-server start do, anyway, I tried nearly all "ubuntu container solution" on dockerhub on my linux machine, none work, maybe all these solution is old... more than one year updated.

Anyway, I will continue to see the difference between your workable solution on alpine & other solution on ubuntu. But if you have any suggestion, I will also be appreciated, thanks.

ehough commented 5 years ago

Previous versions of this image used Debian as its base. The last release to do so was tagged 1.2.0, and you can see the corresponding Dockerfile here.

If you really, really want to run an Ubuntu-based NFS server, you could build a custom version 1.2.0 like this:

$ git clone https://github.com/ehough/docker-nfs-server.git
$ cd docker-nfs-server
$ git checkout v1.2.0
$ docker build --build-arg BUILD_FROM=ubuntu .

You would then have a fully-functioning Ubuntu-based NFS server image. But I would not recommend this, as I can't think of any benefit over using the latest, Alpine-based version of this image.

Is there a particular reason that you prefer an Ubuntu image?

atline commented 5 years ago

Wow, that's useful, thanks!

The reason we have may violate the rule of docker for "one thing one container": just because there is opensource software we used, when it run it will start nfs-kernel-server to let its code to control a IOT device to download from this nfs. The software is based on debian/ubuntu, but its nfs-kernel-server cannot work in container, I just want to find workaround for this software to make it work for us in container.

Really thanks for your help!