With the second generation runtime of Google Cloud Run, it's now possible to mount Google Storage Buckets using gcsfuse.
https://cloud.google.com/run/docs/tutorials/network-filesystems-fuse
The python3 example is working fine. Unfortunately, I keep getting this error with my Dockerfile:
bin/fusermount: failed to open /dev/fuse: Permission denied
mountWithArgs: mountWithConn: Mount: mount: running /bin/fusermount: exit status 1
Dockerfile
# https://github.com/chiaen/docker-gcsfuse
FROM golang:1.17.5-alpine as gcsfuse
RUN apk add --no-cache git
ENV GOPATH /go
RUN go get -u github.com/googlecloudplatform/gcsfuse
FROM composer:2 as vendor
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install --ignore-platform-reqs --no-interaction --prefer-dist
FROM craftcms/nginx:7.4
ENV MNT_DIR /mnt/gcs
USER root
RUN apk add --no-cache mysql-client postgresql-client ca-certificates fuse nano sudo tini bash
RUN mkdir -p $MNT_DIR
RUN chown www-data:www-data $MNT_DIR
USER www-data
COPY --chown=www-data:www-data --from=vendor /app/vendor/ /app/vendor/
COPY --chown=www-data:www-data . .
COPY --from=gcsfuse /go/bin/gcsfuse /usr/local/bin
COPY supervisor.conf /etc/supervisor/conf.d/supervisor.conf
Since there are a few files, I put all the files into a github repo. https://github.com/internetztube/cloud-run-persistent-storage-issue
USER www-data
from Dockerfile. Plus also printedwhoami
in gcsfuse.sh. User isroot
. Still does not work. I don't think it's a permissions issue, but that something is wrong with the underlying mounting command. – Bernetals -l /dev/fuse
show? – Merle/app $ ls -l /dev/fuse ls: /dev/fuse: No such file or directory
– Berneta