我使用SSHFS在我的主机上挂载远程文件系统,我希望能够从Docker容器中访问它。
我挂载了远程文件系统
sshfs -o idmap=user,uid=$(id -u),gid=$(id -g) user@remote:directory /path/to/sshfs
而且,通过使用Docker,我会根据使用--mount获得以下错误:
docker run -it -v /path/to/sshfs:/target myimage bash
docker: Error response from daemon: error while creating mount source path '/path/to/sshfs': mkdir /path/to/sshfs: file exists.或者-v:
docker run -it --mount src=/path/to/sshfs,target=/target,type=bind myimage bash
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /path/to/sshfs.
See 'docker run --help'能否将sshfs挂载点安装到容器中?
发布于 2018-12-31 21:23:46
需要采取以下步骤:
user_allow_other中的/etc/fuse.confsshfs -o allow_other user@....重新装入FUSE文件系统(确保包括-o allow_other选项)发布于 2022-10-24 09:25:22
详细的一步一步的外部引用:
只需要在我们第一次安装SSHFS时就这样做。下面是一个关于如何在ubuntu中实现此操作的示例。
docker run -it -v /path/to/sshfs:/target myimage bash
发布于 2023-04-05 05:44:51
我有同样的问题,但不能使用"allow_other",因为我没有根权限。但我发现,你可以安装挂载点的父母。
所以你的例子对我来说是这样的:
docker run -it -v /path/to:/target myimage bash当然,它不会像/target那样雪崩,而只能像/target/sshfs那样雪崩。
https://serverfault.com/questions/947182
复制相似问题