2

I am attempting to fuse a dir in a Docker image using gcsfuse. I am using a Debian stretch image, and having trouble working with the fuse package.

I have attempted to install fuse both via apt-get as well as build from the source via the git repo. Both have had their respective problems.

1: After apt-get I receive indication that fuse was successfully installed.

root@a7d6f712fab9:/queue# apt-get install fuse
Reading package lists... Done
Building dependency tree
Reading state information... Done
fuse is already the newest version (2.9.7-1+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@a7d6f712fab9:/queue# apt-get install libfuse-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libfuse-dev is already the newest version (2.9.7-1+deb9u2)

However when running modprobe fuse (what fails during the gcsfuse mount attempt):

root@a7d6f712fab9:/queue# modprobe fuse
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.9.125-linuxkit/modules.dep.bin'
modprobe: FATAL: Module fuse not found in directory /lib/modules/4.9.125-linuxkit

2: When using the tar.gz from source, meson is only available as version 0.37, whereas libfuse requires meson > 0.38 to build properly (from earlier versions).

Here's my Dockerfile:

FROM python:3.6-slim

RUN apt-get update \
    && apt-get install -y libfuse-dev \
    curl \
    gnupg \
    apt-utils \
    lsb-release \
    kmod
RUN export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s` \
    && echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO     main" | tee /etc/apt/sources.list.d/gcsfuse.list \
    && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update \
    && apt-get install -y gcsfuse

COPY . /queue
WORKDIR /queue

I'd like modprobe fuse to actually work, or to understand how I can build fuse/modprobe in a way where the package is identified via modprobe.

Thanks!

walking_the_cow
  • 461
  • 4
  • 16

1 Answers1

1

Docker containers use the host kernel. So if a kernel module needs loading you have to load it on the host machine and not in Docker.

Xypron
  • 2,215
  • 1
  • 12
  • 24