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

Unable to run on ubuntu 18.10 #23

Closed choman closed 5 years ago

choman commented 5 years ago

First off I think this project is pretty cool, and I hope it helps me with my current problem

Anyways, I'm following the guide at https://github.com/ehough/docker-nfs-server/blob/develop/doc/feature/apparmor.md and when I run step 3 (apparmor_parser) I get the following error

AppArmor parser error for /opt/nfs/apparmor_nfs.txt in /opt/nfs/apparmor_nfs.txt at line 3: Could not open 'abstractions/lxc/container-base'

I have the apparmor-utils install and have also tried installing both apparmor-profiles and apparmor-profiles-extra. no joy

Any help would be greatly appreciated

macpijan commented 5 years ago

Hi @choman Try installing lxc. I have already included such hint in this PR: https://github.com/ehough/docker-nfs-server/pull/19/files

choman commented 5 years ago

That worked, sortof... Now I'm getting this during the docker run

mount: mounting rpc_pipefs on /var/lib/nfs/rpc_pipefs failed: Permission denied ----> ----> ERROR: unable to mount rpc_pipefs filesystem onto /var/lib/nfs/rpc_pipefs ---->

ehough commented 5 years ago

@choman could you post your full docker run command? or docker-compose.yml etc.

mount: mounting rpc_pipefs on /var/lib/nfs/rpc_pipefs failed: Permission denied

Seems to indicate that either the correct AppArmor profile isn't loaded into the kernel, or you're missing the security-opt portion of your docker run command (i.e. step 4 from the AppArmor guide).

@macpijan I'm so sorry that I haven't yet merged your PR. I promise that I haven't forgotten! It will get done..

choman commented 5 years ago

secuirty-opt was missing. Thanks. off to the next issue

choman commented 5 years ago

My docker run command docker container run -v /opt/nfs/home:/data -v /opt/nfs/exports:/etc/exports:ro --security-opt apparmor=erichough-nfs --cap-add SYS_ADMIN -p 2049:2049 erichough/nfs-server

ehough commented 5 years ago

off to the next issue

Were you able to get everything working? You mentioned a "next issue" but your follow-up comment didn't make it clear to me if there was another problem that we needed to address. Let me know!

choman commented 5 years ago

So I think I have it working, ssh in to the system works. but if I log into the system via the desktop I'm hanging then booted. Still digging into it. I'll post back if it's docker-nfs related.

I will say I had to add other ports to the docker container to get this far

ehough commented 5 years ago

I think I have it working ... Still digging into it. I'll post back if it's docker-nfs related.

OK. I'll close this issue for now, but definitely post back with any follow-up questions or trouble.

I will say I had to add other ports to the docker container to get this far

I'd be interested in hearing what you had to add, just to make sure that the docs or the image isn't missing anything. Thanks!

linuxemb commented 4 years ago

@ehough I have the same issue,in order to add security-opt apparmor=erichough-nfs,

sudo apparmor_parser -r -W ./apparmor_file AppArmor parser error for ./apparmor_file in ./apparmor_file at line 3: Could not open 'abstractions/lxc/container-base'

cat apparmor_file

include <tunables/global>

profile erichough-nfs flags=(attach_disconnected,mediate_deleted) {

include <abstractions/lxc/container-base>

mount fstype=nfs*, mount fstype=rpc_pipefs,