【问题标题】:How to mount an NFS share with rootless Podman?如何使用无根 Podman 挂载 NFS 共享?
【发布时间】:2022-07-14 23:41:56
【问题描述】:

如何挂载 NFS 共享 mynfsserver.example.com:/path/to/share 在运行无根 Podman 时?

截至今天(2022 年 1 月 8 日),我正在运行最新发布的 Podman。

$ podman --version
podman version 3.4.4
$

Linux 内核版本为 5.15.12

$ uname -r
5.15.12-200.fc35.x86_64
$

【问题讨论】:

    标签: mount nfs podman rootless


    【解决方案1】:

    2022 年 5 月 31 日更新

    我不确定这个答案是否正确。 我还在 Podman Github 存储库的讨论论坛中询问了 question


    旧答案

    支持无根挂载 NFS 共享 如果您正在运行 Podman 和 Linux 内核的最新开发分支,Podman 现在支持。

    在运行无根 Podman 时挂载 NFS 共享:

    podman volume create --opt type=nfs --opt o=async --opt device=mynfsserver.example.com:/path/to/share

    不幸的是,官方包中的支持需要一些时间。 (Podman 3.4.4Linux 5.15.12 不支持)

    参考资料:

    2022 年 1 月 6 日 Podman 聊天频道消息:

    Rootless mounting of NFS just got merged into upstream kernel

    podman volume create --opt type=nfs --opt o=async --opt device=mynfsserver:/path/to/share 21:49 neat that it works rootless now

    【讨论】:

    • 你能复制那些链接的内容吗?如果您没有设置矩阵,则很难访问内容。
    • 我从聊天中添加了一些文本。不幸的是,虽然我没有尝试太多,但我自己还没有得到它。
    【解决方案2】:

    这并不能直接回答您的问题。我可以挂载一个已经挂载在主机文件系统上的 NFS 目录

    podman run --runtime=/usr/bin/crun --group-add=keep-groups --volume=/storage/nfs/outside_dir:/in_container_dir --storage-driver overlay --storage-opt "overlay.mount_program=/usr/bin/fuse-overlayfs" --userns=keep-id -it registry.access.redhat.com/ubi8/ubi
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-22
      • 2023-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-16
      • 2013-11-25
      相关资源
      最近更新 更多