How to mount nfs on alpine linux

How to set NFS on alpine linux.

Install nfs-utils

$ apk add nfs-utils
$ rc-update add nfsmount
$ rc-service nfsmount start

Mount NFS

$ mount -t nfs ${NFS_SEVER}:${NFS_DIR} /mnt

Mount NFS on boot

Add a line in /etc/fstab:

${NFS_SEVER}:${NFS_DIR} /mnt nfs _netdev 0 0

LXC

If you use LXC in pve, an error may occured like this:

* Starting NFS statd ...
 * start-stop-daemon: failed to start `/usr/sbin/rpc.statd'                                                                                                         [ !! ]
 * ERROR: rpc.statd failed to start
 * ERROR: cannot start nfsmount as rpc.statd would not start

See ref to solve this problem.

REF