1

I'm trying to use gcsfuse to mount GCS buckets in a docker container deployed in a GAE flexible custom runtime instance. This is part of the Dockerfile:

FROM gcr.io/google-appengine/python

RUN apt-get -y update
RUN apt-get -y install lsb-release
RUN echo "deb http://packages.cloud.google.com/apt gcsfuse-$(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gcsfuse.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get -y update
RUN apt-get -y install fuse gcsfuse

Then from the docker container I get an error when I run:

# gcsfuse --key-file=gcs_credentials.json bucket_name /tmp/mount_path
Using mount point: /tmp/mount_path
Opening GCS connection...
Opening bucket...
Mounting file system...
daemonize.Run: readFromProcess: sub-process: mountWithArgs: mountWithConn: Mount: mount: running fusermount: exit status 1
stderr:
fusermount: fuse device not found, try 'modprobe fuse' first

Then as suggested by the error message I run:

# modprobe fuse
bash: modprobe: command not found

I've seen in some other questions that I should run the docker container in privileged mode but I can't find how to do that with the container running in a GAE instance. Is there any other way?

dablak
  • 111
  • 1
  • Please ask this question at Stack Overflow since it is related to that forum of discussion. – Philipp Sh Aug 06 '18 at 08:23
  • 1
    I'm pretty sure that it belongs here. Check this https://serverfault.com/help/on-topic – dablak Aug 06 '18 at 09:10
  • Possible duplicate & solution https://stackoverflow.com/questions/56254714/problem-running-gcsfuse-on-google-app-engine – jon_wu Jul 03 '19 at 07:37

1 Answers1

0

The problem is security context and privileges:

In Kuberentes:

securityContext:
  capabilities:
    add:
    - SYS_ADMIN
  privileged: true

In Docker you can try this question

kasperd
  • 29,894
  • 16
  • 72
  • 122
jbelenus
  • 101