Thursday, May 17, 2018

Use nfs server docker container to set up nfs server

1. Start up a server:

docker run -d --name nfs --privileged --net=host  \
    -v /home/ubuntu/logs:/nfsshare -e SHARED_DIRECTORY=/nfsshare \
    itsthenetwork/nfs-server-alpine:latest

2. Now to mount that share, a client using ubuntu will need to have nfs-common installed.

sudo apt install -y nfs-common

now mount the share to a directory named test

sudo mount -v 192.168.56.106:/ test

now dismount the share.

sudo umount test

These mounted directory owned by root, can only be changed by root users.

No comments:

Post a Comment