3

I am trying to mount a FUSE virtual filesystem from inside a Docker container and expose the mount point to the host.

Docker is installed via snap on Ubuntu 20.04

The software is a fresh install of Seafile (a Dropbox alternative), but this problem I believe is more related to Docker, snap, and mounting file systems on Ubuntu. For what it's worth, I was following the official instructions here.

Inside the container (when it runs successfully), a script mounts a FUSE virtual filesystem to /seafile-fuse that makes the all files stored within Seafile visible.

docker-compose.yml exerpt:

version: '3.3'
services: 
  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    volumes:
      - /home/jonathan/seafile/seafile-data:/shared
      - type: bind
        source: /home/jonathan/seafile/seafile-fuse
        target: /seafile-fuse
        bind:
          propagation: rshared
    privileged: true
    cap_add:
      - SYS_ADMIN

This leads to:

ERROR: for seafile  Cannot start service seafile: path /home/jonathan/seafile/seafile-fuse is mounted on /home but it is not a shared mount

I found this somewhat related answer which hints that the issue may to do with the docker daemon running in a different namespace. But I am unable to get his solution to work.

What do I need to do to connect the host directory /home/jonathan/seafile/seafile-fuse so that it sees the container directory /seafile-fuse?

Bonus question...

Given that this is to be an internet facing home-server, is it necessary this this becomes a privileged container? Are there better options?

Thanks!!

jonathanbsyd
  • 8,031
  • 6
  • 24
  • 26
  • Instead of mounting the filesystem from inside a theoretically-isolated container and trying to export it, why not run the mount directly on the host? (I think for this use case, yes, it must be privileged.) – David Maze Jan 18 '22 at 11:29

0 Answers0