简体   繁体   English

NFS 在没有卷挂载的情况下无法在 docker 上工作

[英]NFS does not work on docker without a volume mount

It works.有用。

$ docker run --rm --net=host --privileged -v $PWD:/home -e SHARED_DIRECTORY=/home itsthenetwork/nfs-server-alpine

[..]

/home             <world>
Starting Mountd in the background...These
Startup successful.

It doesn't work.它不起作用。

$ docker run --rm --net=host --privileged -e SHARED_DIRECTORY=/home itsthenetwork/nfs-server-alpine

[..]

exportfs: /home does not support NFS export
Export validation failed, exiting...

I don't know why it's not working.我不知道为什么它不起作用。 The only difference is whether volume mount or not.唯一的区别是是否挂载卷。

Please teach me.请教我。

self-solving自我解决

OverlayFS覆盖FS

OverlayFS does not support NFS export so please volume mount into your NFS container from an alternative (hopefully one is available). OverlayFS 不支持 NFS 导出,因此请从替代方案(希望有一个可用)将卷装入您的 NFS 容器。

On RancherOS the /home, /media and /mnt file systems are good choices as these are ext4.在 RancherOS 上,/home、/media 和 /mnt 文件系统是不错的选择,因为它们是 ext4。

https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/ https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM