mkdir -p /opt/nfs-server/share
docker rm -f nfs-server
docker run \
-d \
--name nfs-server \
--restart=always \
--privileged \
-p 32049:2049 \
-v /opt/nfs-server/share:/nfsshare \
-e NFS_DIR=/nfsshare \
-e NFS_DOMAIN=* \
-e NFS_OPTION="fsid=0,rw,sync,no_root_squash,all_squash,anonuid=0,anongid=0,no_subtree_check" \
gists/nfs-server
docker logs -f nfs-server
# docker run \
# -d \
# --name nfs-server \
# --restart=always \
# --privileged \
# -p 32049:2049 \
# -v /opt/nfs-server/share:/nfsshare \
# -e SHARED_DIRECTORY=/nfsshare \
# -e SYNC=true \
# itsthenetwork/nfs-server-alpine
客户端:
mkdir -p /data/nfs-share
# 挂载
mount -v -t nfs -o port=32049 主机:/ /data/nfs-share
# 卸载
umount /data/nfs-share
对哦,国内用不了docker 嘻嘻(●’◡’●)