使用Docker卷与NFS分区 [英] Using docker volume with a NFS partition

查看:198
本文介绍了使用Docker卷与NFS分区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果将主机上的NFS分区添加到

I have a NFS partition on the host, if add it to a container with

docker run -i -t -v /srv/nfs4/dir:/mnt ubuntu

/ mnt将包含共享数据,不会造成冲突?既然它没有使用nfs-client装载?

/mnt will contain the shared data, but doesn't it cause conflicts? Since it hasn't been mounted with nfs-client?

推荐答案

Docker 使用绑定装载与容器共享主机目录。 Docker处理命名空间权限,以便容器可以访问安装。否则从主机的角度来看,绑定的NFS共享只是被其他进程访问。绑定NFS文件系统上其他位置的NFS共享是安全的。在Docker容器中使用它没有什么不同。

Docker uses bind mounts to share host directories with containers. Docker handles namespace permission so that the container can access the mount. Otherwise from the host's perspective, the bind mounted NFS share is just being accessed by another process. It's safe to bind mount an NFS share elsewhere on the filesystem. Using it from within a Docker container is no different.

这篇关于使用Docker卷与NFS分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆