Ral*_*lph 17 ssh mount fuse sshfs docker
我使用 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.
Run Code Online (Sandbox Code Playgroud)
或-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'
Run Code Online (Sandbox Code Playgroud)
是否可以将 sshfs 挂载点挂载到容器中?
Mic*_*ton 19
需要以下步骤:
取消注释user_allow_other中/etc/fuse.conf
卸载 FUSE 文件系统
重新挂载 FUSE 文件系统sshfs -o allow_other user@....(确保包含该-o allow_other选项)
尝试再次启动容器
| 归档时间: |
|
| 查看次数: |
11747 次 |
| 最近记录: |