sjiveson / nfs-server-alpine

A handy Alpine Linux based NFS Server image running NFS v4 only, over TCP on port 2049
https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/
GNU General Public License v3.0
295 stars 187 forks source link

Start failed on Synology #27

Closed djonasdev closed 5 years ago

djonasdev commented 5 years ago

When starting on my Synology I get the following error. privileged: true is set. Someone can give me a hint what'S the problem?

docker-compose.yml

version: '2'
services:
  nfs-server:
    privileged: true
    container_name: nfs-server
    restart: unless-stopped
    image: itsthenetwork/nfs-server-alpine
    environment: 
    - TZ=Europe/Berlin
    - VERSION=latest
    - SHARED_DIRECTORY=/nfsshare
    ports:
    - "2049:2049"

    volumes:
    - /volume1/Kids:/nfsshare

Log

nfs-server
date,stream,content
2019-01-28 13:23:39,stdout,Startup successful.

2019-01-28 13:23:39,stdout,Starting Mountd in the background...These

2019-01-28 13:23:39,stdout,/nfsshare        <world>

2019-01-28 13:23:39,stdout,exporting *:/nfsshare

2019-01-28 13:23:39,stdout,Exporting File System...

2019-01-28 13:23:39,stderr,"Please try, as root, 'mount -t nfsd nfsd /proc/fs/nfsd' and then restart rpc.nfsd to correct the problem
"
2019-01-28 13:23:39,stderr,rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).

2019-01-28 13:23:39,stdout,Starting NFS in the background...

2019-01-28 13:23:39,stdout,    100000    3    local     /var/run/rpcbind.sock  -          superuser

2019-01-28 13:23:39,stdout,    100000    4    local     /var/run/rpcbind.sock  -          superuser

2019-01-28 13:23:39,stdout,    100000    2    udp       0.0.0.0.0.111          -          superuser

2019-01-28 13:23:39,stdout,    100000    3    udp       0.0.0.0.0.111          -          superuser

2019-01-28 13:23:39,stdout,    100000    4    udp       0.0.0.0.0.111          -          superuser

2019-01-28 13:23:39,stdout,    100000    2    tcp       0.0.0.0.0.111          -          superuser

2019-01-28 13:23:39,stdout,    100000    3    tcp       0.0.0.0.0.111          -          superuser

2019-01-28 13:23:39,stdout,    100000    4    tcp       0.0.0.0.0.111          -          superuser

2019-01-28 13:23:39,stdout,    100000    3    udp6      ::.0.111               -          superuser

2019-01-28 13:23:39,stdout,    100000    4    udp6      ::.0.111               -          superuser

2019-01-28 13:23:39,stdout,    100000    3    tcp6      ::.0.111               -          superuser

2019-01-28 13:23:39,stdout,    100000    4    tcp6      ::.0.111               -          superuser

2019-01-28 13:23:39,stdout,   program version netid     address                service    owner

2019-01-28 13:23:39,stdout,Displaying rpcbind status...

2019-01-28 13:23:39,stdout,Starting rpcbind...

2019-01-28 13:23:39,stdout,

2019-01-28 13:23:39,stdout,"/nfsshare *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)
"
2019-01-28 13:23:39,stdout,Displaying /etc/exports contents:

2019-01-28 13:23:39,stdout,Writes will not be immediately written to disk.

2019-01-28 13:23:39,stdout,"The SYNC environment variable is unset or null, defaulting to 'async' mode.
"
2019-01-28 13:23:39,stdout,Clients have read/write access.

2019-01-28 13:23:39,stdout,"The READ_ONLY environment variable is unset or null, defaulting to 'rw'.
"
2019-01-28 13:23:39,stdout,This means any client can mount.

2019-01-28 13:23:39,stdout,"The PERMITTED environment variable is unset or null, defaulting to '*'.
"
2019-01-28 13:23:39,stdout,Writing SHARED_DIRECTORY to /etc/exports file

2019-01-28 13:23:36,stdout,Terminated.

2019-01-28 13:23:36,stdout,"SIGTERM caught, terminating NFS process(es)...
"
2019-01-28 13:18:29,stdout,Startup successful.

2019-01-28 13:18:29,stdout,Starting Mountd in the background...These

2019-01-28 13:18:29,stdout,/nfsshare        <world>

2019-01-28 13:18:29,stdout,exporting *:/nfsshare

2019-01-28 13:18:29,stdout,Exporting File System...

2019-01-28 13:18:29,stderr,"Please try, as root, 'mount -t nfsd nfsd /proc/fs/nfsd' and then restart rpc.nfsd to correct the problem
"
2019-01-28 13:18:29,stderr,rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).

2019-01-28 13:18:29,stdout,Starting NFS in the background...

2019-01-28 13:18:29,stdout,    100000    3    local     /var/run/rpcbind.sock  -          superuser

2019-01-28 13:18:29,stdout,    100000    4    local     /var/run/rpcbind.sock  -          superuser

2019-01-28 13:18:29,stdout,    100000    2    udp       0.0.0.0.0.111          -          superuser

2019-01-28 13:18:29,stdout,    100000    3    udp       0.0.0.0.0.111          -          superuser

2019-01-28 13:18:29,stdout,    100000    4    udp       0.0.0.0.0.111          -          superuser

2019-01-28 13:18:29,stdout,    100000    2    tcp       0.0.0.0.0.111          -          superuser

2019-01-28 13:18:29,stdout,    100000    3    tcp       0.0.0.0.0.111          -          superuser

2019-01-28 13:18:29,stdout,    100000    4    tcp       0.0.0.0.0.111          -          superuser

2019-01-28 13:18:29,stdout,    100000    3    udp6      ::.0.111               -          superuser

2019-01-28 13:18:29,stdout,    100000    4    udp6      ::.0.111               -          superuser

2019-01-28 13:18:29,stdout,    100000    3    tcp6      ::.0.111               -          superuser

2019-01-28 13:18:29,stdout,    100000    4    tcp6      ::.0.111               -          superuser

2019-01-28 13:18:29,stdout,   program version netid     address                service    owner

2019-01-28 13:18:29,stdout,Displaying rpcbind status...

2019-01-28 13:18:29,stdout,Starting rpcbind...

2019-01-28 13:18:29,stdout,

2019-01-28 13:18:29,stdout,"/nfsshare *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)
"
2019-01-28 13:18:29,stdout,Displaying /etc/exports contents:

2019-01-28 13:18:29,stdout,Writes will not be immediately written to disk.

2019-01-28 13:18:29,stdout,"The SYNC environment variable is unset or null, defaulting to 'async' mode.
"
2019-01-28 13:18:29,stdout,Clients have read/write access.

2019-01-28 13:18:29,stdout,"The READ_ONLY environment variable is unset or null, defaulting to 'rw'.
"
2019-01-28 13:18:29,stdout,This means any client can mount.

2019-01-28 13:18:29,stdout,"The PERMITTED environment variable is unset or null, defaulting to '*'.
"
2019-01-28 13:18:29,stdout,Writing SHARED_DIRECTORY to /etc/exports file
djonasdev commented 5 years ago

adding cap_add: - SYS_ADMIN solved the problem:

version: '2'
services:
  nfs-server:
    privileged: true
    container_name: nfs-server
    restart: unless-stopped
    image: itsthenetwork/nfs-server-alpine
    cap_add:
      - SYS_ADMIN
    environment: 
    - TZ=Europe/Berlin
    - VERSION=latest
    - SHARED_DIRECTORY=/nfsshare
    ports:
    - "2049:2049"

    volumes:
    - /volume1/Kids:/nfsshare
sjiveson commented 5 years ago

Odd, as privileged should give you every capability. I wonder if there is something special about using it on a Synology?

djonasdev commented 5 years ago

Ok the problem is not solved. If you run the NFS Service on the host and then the container, the docker container is possible to start and load the kernel modules. But actually it is not working. So I think there is a limitation to use it on a synology.

sjiveson commented 5 years ago

Wouldn't it be better to use the Synology's built in NFS functionality anyway?

djonasdev commented 5 years ago

Synology use ecryptfs. Synology does actually (since 4 years) not support nfs in combination with encrypted folders. That's the reason why..

sjiveson commented 5 years ago

Ah OK, so it's simply not going to work. I'll close then.