问题原文
原帖链接 · Ralph · CC BY-SA 4.0
I use SSHFS to mount a remote filesystem on my host and I want to be able to access it from inside a Docker container.
I mount the remote filesystem
sshfs -o idmap=user,uid=$(id -u),gid=$(id -g) user@remote:directory /path/to/sshfs
And, using Docker, I get the following errors depending on me using --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.
or -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'
Is it possible to mount a sshfs mountpoint into a container?
已采纳解答
原帖链接 · Michael Hampton · CC BY-SA 4.0
Requires the following steps:
uncomment
user_allow_otherin/etc/fuse.confunmount the FUSE filesystem
remount the FUSE filesystem with
sshfs -o allow_other user@....(making sure to include the-o allow_otheroption)try starting the container again
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
