nschlia / ffmpegfs

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.
https://nschlia.github.io/ffmpegfs/
GNU General Public License v3.0
198 stars 14 forks source link

[2.3] Add Docker support #79

Closed nschlia closed 3 years ago

nschlia commented 3 years ago

There have been requests to add Docker support to FFmpegfs.

  1. Add a Dockerfile to the distribution
  2. If run in Docker and the mount point for FUSE is also a mount point for the Docker image, making it accessible from outside of Docker. With FMpegfs an error "already mounted" is reported. An empty directory inside the Docker mount point must be created and used as mount point for FUSE.
nschlia commented 3 years ago

FFmpegfs refuses to mount on the Docker mount point with an "already mounted" message. This is by design to avoid mounting over an existing mount. In case of Docker this should be possible, though.

Easiest solution would be a command line parameter, e.g., --nomountcheck, but this could be dangerous and the user needs to know about it to make Docker support work properly.

It would be better to detect whether we are running under Docker, and if so, do not refuse to mount over the Docker mount.

To detect Docker, check for the string ‘/docker’ in /proc/self/cgroup

See:

https://stackoverflow.com/questions/20010199/how-to-determine-if-a-process-runs-inside-lxc-docker https://tuhrig.de/how-to-know-you-are-inside-a-docker-container/

nschlia commented 2 years ago

Docker support now OK, see #112 and https://github.com/nschlia/ffmpegfs/blob/master/README.md#building-a-docker-container how to use it.