大网数据广告活动
服务器运维问答

Using a FUSE-mounted directory as a docker volume

· 52CE 我爱测

I have a mount (/mnt/xyz) which is mounted with FUSE, and I want to use it as a docker volume docker run image -v /mnt/xyz/container-dir:/container-dir But I get the error docker: Error response from daemon: error while creating …

问题原文

原帖链接 · iDPWF1 · CC BY-SA 4.0

I have a mount (/mnt/xyz) which is mounted with FUSE, and I want to use it as a docker volume docker run image -v /mnt/xyz/container-dir:/container-dir

But I get the error docker: Error response from daemon: error while creating mount source path '/mnt/xyz/container-dir': mkdir /mnt/xyz: file exists.

Running the same image with docker run image -v /mnt/tmp:/container-dir succeeds but I want the files on the remote dir, not locally on the ephemeral instance.

Some more info: The instance is a google cloud VM running Ubuntu 18.04. The mounted dir is a FUSE-mounted google drive, it's accessible and writeable.

Any help or ideas will be appreciated...

社区高分解答

原帖链接 · badc0de · CC BY-SA 4.0

Although this is an old question I recently had the same problem. It was trying to use a directory inside a fuse mount as a volume in docker-compose. The fuse mount was created by the seadrive-daemon (from the Seafile project) but the found solution is pretty standard.

The problem is that root doesn't have access to the fuse mount. You can check this by login in as root and performing a simple ls of the folder in question. You need to mount the fuse drive with the option "allow_root". Either in /etc/fstab or in my case passing the option to the seadrive-daemon with -o allow_root.

In order to be able to even use the allow_root option as non-root user you must enable it in /etc/fuse.conf by uncommenting or adding the following line:

user_allow_other

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-12-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。