Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1023 Bytes

README.md

File metadata and controls

26 lines (16 loc) · 1023 Bytes

nfs-server

Deployment of NFS server, to share contents (Docker Swarm volumes) between different hosts

AppArmor

If your Docker host has AppArmor activated, you'll need to perform additional steps to allow the container to start an NFS server.

  1. Ensure you have the apparmor-utils and lxc packages installed on the Docker host. e.g. for Debian or Ubuntu:

    sudo apt-get install apparmor-utils lxc
    
  2. Create a file on the Docker host with the following contents:

    #include <tunables/global>
    profile nfs-server flags=(attach_disconnected,mediate_deleted) {
      #include <abstractions/lxc/container-base>
      mount fstype=nfs*,
      mount fstype=rpc_pipefs,
    }
    
  3. Load this profile into the kernel with apparmor_parser:

    sudo apparmor_parser -r -W /path/to/file/from/previous/step
    
  4. If profile does not survive reboot, place it at /etc/apparmor.d/.