FUSEをマウントしたディレクトリを、Dockerのvolumeとしてマウントしたい

ホストにて、FUSEをマウントしたディレクトリを、Dockerコンテナから参照しようとすると、Permission deniedになってしまう。

# ls volume_directory
ls: cannot access 'volume_directory': Permission denied

対策

参考文献の通り、設定を変更する。

  • ホスト側のFUSEの設定を変更する(other userのアクセスを許可)
  • FUSEのマウントオプションとして、allow_root or allow_otherを指定する。
$ sudo vi /etc/fuse.conf
# Allow non-root users to specify the allow_other or allow_root mount options.
user_allow_other << コメントアウトを解除する
$ google-drive-ocamlfuse -o allow_root mount_point

参考文献

github.com