4

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...

iDPWF1
  • 141
  • 1
  • 4

1 Answers1

3

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

badc0de
  • 51
  • 2