Docker-使用 NFS 组合过多级别的符号链接

问题描述 投票:0回答:5

我正在尝试批量挂载 nfs 共享,但遇到了一些问题。当我运行常规 docker 命令时,例如:

docker run -i -t privileged=true -v /mnt/bluearc:/mnt/bluarc -v /net:/net ubuntu bash

我已将所需的驱动器安装在

/mnt/bluearc
。但是,如果我使用 docker-compose 运行它:

test_ser:
  container_name: test_ser
  hostname: test_ser
  image: ubuntu
  restart: always
  working_dir: /repo/drop_zone_dub
  volumes_from:
    - nerve_repo_data
  volumes:
    - /mnt/bluearc:/mnt/bluearc
    - /net:/net
  privileged: true
  command: bash

当我尝试访问目录时,出现以下错误:

Too many levels of symbolic links

compose 做了什么不同的事情会导致这种情况?

docker docker-compose nfs
5个回答
6
投票

我遇到了同样的问题,并在这里找到了一个隐藏的 docker 参数:

https://github.com/moby/moby/issues/24303

-v /nfs:/nfs:shared

到目前为止,它对我有用。


0
投票

我怀疑这与 Docker 和 Automounting 有关。 请参阅https://serverfault.com/questions/640895/why-do-some-host-volumes-in-docker-containers-give-the-error-too-many-levels-of 这似乎是 Docker 无法做到的事情。


0
投票

我们通常使用:

-v /nfs:/nfs:slave

我们发现它与 autofs/auto-mounter 配合使用效果更好。


0
投票

在这个帖子中,我找到了解决方案 https://github.com/docker/for-win/issues/5763

通过

docker-desktop
恢复到旧版本的
chocolately
对我有帮助。

choco uninstall docker-desktop
choco install docker-desktop --version=2.1.0.5 --allow-downgrade

这个问题显然是windows使用的linux内核的问题。


0
投票

我们使用 podman 但遇到了同样的问题。 我们的解决方案是:

-v /nfs:/nfs:从站

这个命令运行完美,我们没有错误

© www.soinside.com 2019 - 2024. All rights reserved.