#nfs
##Resources
/usr/bin/docker run --name nfs \
-v /mnt/a:/exports/a \
-v /mnt/b:/exports/b_ro \
quay.io/bigm/nfs
IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' nfs)
showmount -e $IP
mkdir /tmp/nfs-share
mount -t nfs $IP:/exports/tmp /tmp/nfs-share
It works because:
/etc/default/nfs-kernel-server is patched to use fix port 2233 in RPCMOUNTDOPTS/etc/exports contains keyword insecure to allow usage of complete port rangeFirst make sure that ssh <user>@<docker_host> works.
# on docker host to know the Docker container IP
IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' nfs)
# on client
ssh -Nv -L 3049:$IP:2049 -L 3233:$IP:2233 <user>@<docker_host>
sudo mount -t nfs -o tcp,port=3049,mountport=3233 localhost:/exports/tmp /tmp/master
NFS_EXPORT_FOLDER subfolders in this directory will be exported, subforlders ending with _ro as read only, default is /exports
Content type
Image
Digest
sha256:d7777d193…
Size
74.1 MB
Last updated
about 8 years ago
docker pull bigm/nfs