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

Fails on raspberry zero w #19

Closed AnderssonPeter closed 6 years ago

AnderssonPeter commented 6 years ago

Hi im trying to use this container using docker-compose

  nfsserver:
    image: itsthenetwork/nfs-server-alpine:9-arm
    restart: unless-stopped
    volumes:
      - /data/share:ro
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      SHARED_DIRECTORY: /share
      READ_ONLY: 'true'
    privileged: true
    ports:
      - "2049:2049/tcp"
      - "2049:2049/udp"
      - "111:111/tcp"
      - "111:111/udp"

using the same setup on a pi3 works.

log:

The PERMITTED environment variable is missing or null, defaulting to '*'.
Any client can mount.
The SYNC environment variable is missing or null, defaulting to 'async'.
Writes will not be immediately written to disk.
Starting Confd population of files...
/usr/bin/nfsd.sh: line 91:     7 Illegal instruction     (core dumped) /usr/bin/confd -version

Displaying /etc/exports contents...
/usr/bin/nfsd.sh: line 91:     8 Illegal instruction     (core dumped) /usr/bin/confd -onetime
# /etc/exports
#
# See exports(5) for a description.

# use exportfs -arv to reread
#/export    192.168.1.10(rw,no_root_squash)

Starting rpcbind...
Displaying rpcbind status...
   program version netid     address                service    owner
    100000    4    tcp6      ::.0.111               -          superuser
    100000    3    tcp6      ::.0.111               -          superuser
    100000    4    udp6      ::.0.111               -          superuser
    100000    3    udp6      ::.0.111               -          superuser
    100000    4    tcp       0.0.0.0.0.111          -          superuser
    100000    3    tcp       0.0.0.0.0.111          -          superuser
    100000    2    tcp       0.0.0.0.0.111          -          superuser
    100000    4    udp       0.0.0.0.0.111          -          superuser
    100000    3    udp       0.0.0.0.0.111          -          superuser
    100000    2    udp       0.0.0.0.0.111          -          superuser
    100000    4    local     /var/run/rpcbind.sock  -          superuser
    100000    3    local     /var/run/rpcbind.sock  -          superuser
Starting NFS in the background...
rpc.nfsd: knfsd is currently down
rpc.nfsd: Writing version string to kernel: -2 -3 +4
rpc.nfsd: Created AF_INET TCP socket.
rpc.nfsd: Created AF_INET6 TCP socket.
Exporting File System...
exportfs: No file systems exported!
Starting Mountd in the background...
Startup successful.

im using hypriot os on both units, the pi zero is using a somewhat older version.

sjiveson commented 6 years ago

Hey. It looks like confd is causing this issue. Also, you are specifying a SHARED_DIRECTORY of /share but mounting in /data/share which won't help. Also note there is no need to expose port 111 for either TCP or UDP, or port 2049 for UDP (it'll only work over TCP).

I'm in the usual position where I can't test this in any way. What I will do (which I need to do anyway as there is an apk bug in Alpine v3.7) is rebuild the x86 and arm images tonight with Alpine v3.8 if possible. This will also make use of the multistage build changes introduced recently which might help.

Ultimately though it'll be luck if this helps. What might be better is if I ditch confd entirely and switch to using sed/awk to build the exports file. This will remove the need for the multi-stage build and make the image much smaller. I'll give that some thought.

AnderssonPeter commented 6 years ago

Thanks for your fast reply! - /data/share:ro was a typo it was supposed to be - /home/peter:/share:ro, and that is what i was running with. So that's not the issue. If you get the time to create a updated docker image please give me a shout out and ill check if your changes work or not!

sjiveson commented 6 years ago

FYI, I've got to this and the work is in branch byebyeconfd - hope to be done soon.

AnderssonPeter commented 6 years ago

It seems to work! Thanks for your hard work!

sjiveson commented 6 years ago

Great to hear. You're welcome.

I've just been testing and the SYNC and READONLY options were not working, I've fixed it but need to do a few more things before I push. Should be done tomorrow.

sjiveson commented 6 years ago

All done, merged into master and Docker Hub images updated.

jSadoski commented 5 years ago

A bit of confusion here on my part: I have the same issue on my raspi3b. I don't see any updates to the arm branch, and no recent updates on Docker hub. Has this been updated for the arm branch already?

sjiveson commented 5 years ago

You're right, I seem to have not pushed an updated image. I'll do so soon. Thanks for your patience.

sjiveson commented 5 years ago

I needed to do some work on the arm branch which is now done but I'm currently unable to build due to some issues connecting to my rpi. May take a few days to fix (work etc.) but in the meantime feel free to build yourself from the arm branch which now has all the changes around removing Confd.

jSadoski commented 5 years ago

It built!

Just for documentation, I'm running my setup on a balena.io instance on my Raspberry Pi 3b. For this reason, I cannot use the Alpine image (it doesn't build under the right arch), so I had to change the FROM alpine:latest to FROM balenalib/armv7hf-alpine-python just to get a pre-built Alpine image. I assume it would build just fine on the standard alpine image as well. Everything ran smoothly, and I'm now sharing my network-attached storage. Thanks!

sjiveson commented 5 years ago

Excellent, thanks for the info, might be useful for others.