gcsfuse on Alpine DockerDoes GCSFuse use a VFS?docker, alpine, and matplotlibDoes gcsfuse sync all data to the system it is mounted on?Cannot login on Zabbix docker installationNo php errors in Alpine/Nginx/PHP 7.1.2 with dockerAlpine shell can't find file in dockerUsing PhangomJS in Docker Alpinegcsfuse affecting wordpress performanceInstalling Shapely on Alpine dockerInstalling Chromium on Alpine Linux, strange error

Can the concepts of abstract algebra be visualized as in analysis?

Heap allocation on microcontroller

What ways have you found to get edits from non-LaTeX users?

Does the Long March-11 increase its thrust after clearing the launch tower?

Is using 'echo' to display attacker-controlled data on the terminal dangerous?

Why am I getting a strange double quote (“) in Open Office instead of the ordinary one (")?

Why does the Mishnah use the terms poor person and homeowner when discussing carrying on Shabbat?

Generate basis elements of the Steenrod algebra

New pedal fell off maybe 50 miles after installation. Should I replace the entire crank, just the arm, or repair the thread?

What is the color of artificial intelligence?

Getting UPS Power from One Room to Another

How to hide an urban landmark?

GroupBy operation using an entire dataframe to group values

Non-aqueous eyes?

Why we don’t make use of the t-distribution for constructing a confidence interval for a proportion?

Let M and N be single-digit integers. If the product 2M5 x 13N is divisible by 36, how many ordered pairs (M,N) are possible?

What aircraft was used as Air Force One for the flight between Southampton and Shannon?

Is it safe to change the harddrive power feature so that it never turns off?

Check if three arrays contains the same element

Why is a common reference string needed in zero knowledge proofs?

Longest bridge/tunnel that can be cycled over/through?

Interval of parallel 5ths in the resolution of a German 6th chord

How can I get an unreasonable manager to approve time off?

Fermat's statement about the ancients: How serious was he?



gcsfuse on Alpine Docker


Does GCSFuse use a VFS?docker, alpine, and matplotlibDoes gcsfuse sync all data to the system it is mounted on?Cannot login on Zabbix docker installationNo php errors in Alpine/Nginx/PHP 7.1.2 with dockerAlpine shell can't find file in dockerUsing PhangomJS in Docker Alpinegcsfuse affecting wordpress performanceInstalling Shapely on Alpine dockerInstalling Chromium on Alpine Linux, strange error






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I try to use gcsfuse in order to store application source code on a GCP bucket, here's my Dockerfile:



ARG VERSION

FROM golang:1.12.5-alpine3.9 as gcsfuse-builder

ENV GOPATH /go

RUN apk --update add git=2.20.1-r0 fuse=2.9.8-r2 fuse-dev=2.9.8-r2
&& go get -u github.com/googlecloudplatform/gcsfuse

FROM php:$VERSION as base

ARG REVISION

ENV APP_DIR=/srv/app
APP_ENV=prod
APP_FRONT_CONTROLLER=index.php
APP_LOCALE=fr
APP_USER=test-user
APP_USER_GROUP=test
APP_PORT=8080
COMPOSER_ALLOW_SUPERUSER=1
NGINX_DIR=/etc/nginx
NGINX_VERSION=1.14.2-r1
PHP_FPM_CONF_DIR=/usr/local/etc/php-fpm.d/
SUPERVISORD_CONF_DIR=/etc/supervisor
SUPERVISOR_VERSION=3.3.4-r1
BUILD_SCRIPTS_DIR=/build-scripts
GOOGLE_APPLICATION_CREDENTIALS=/srv/app/bucket.json

# Supervisord conf to be copied at the end.
COPY docker/prod/php/scripts/*.sh $BUILD_SCRIPTS_DIR/

# Core dependencies installation (installed as a virtual package in order to remove it later)
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS
&& apk add --no-cache --virtual .fuse-deps curl sshfs fuse
&& apk add --no-cache --virtual .bash bash=4.4.19-r1
&& apk add --no-cache --virtual .core-php-deps icu-dev=62.1-r0
&& rm -rf /var/cache/apk/*
&& docker-php-ext-install
intl
opcache
&& docker-php-ext-configure intl
&& docker-php-ext-enable opcache
&& apk del .build-deps .phpize-deps-configure

# User creation
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted --virtual .user-deps gosu=1.10-r0
&& rm -rf /var/cache/apk/*
&& addgroup $APP_USER_GROUP
&& adduser -D -h /home/portfolio -s /bin/bash -G $APP_USER_GROUP $APP_USER
&& chown -R $APP_USER $BUILD_SCRIPTS_DIR
&& apk del .user-deps

# Nginx & Supervisor installation
RUN apk add --no-cache --virtual .http-deps nginx=$NGINX_VERSION supervisor=$SUPERVISOR_VERSION
&& rm -rf /var/cache/apk/*
&& ln -sf /dev/stdout /var/log/nginx/access.log
&& ln -sf /dev/stderr /var/log/nginx/error.log

# Filesystem (gcsfuse)
COPY --from=gcsfuse-builder /go/bin/gcsfuse /usr/local/bin
COPY bucket.json $APP_DIR/bucket.json

# Filesystem (gcsfuse binding)
RUN apk add --no-cache --virtual .filesystem-deps curl fuse fuse-dev rsync
&& mkdir -p $APP_DIR $BUILD_SCRIPTS_DIR
&& chown -R $APP_USER $APP_DIR
&& chmod -R 755 $APP_DIR
&& gcsfuse mybucketname $APP_DIR

COPY docker/prod/php/conf/php.ini $PHP_INI_DIR/php.ini
COPY docker/prod/php/conf/fpm.conf $PHP_FPM_CONF_DIR/fpm.conf
COPY docker/prod/nginx/conf/nginx.conf $NGINX_DIR/nginx.conf
COPY docker/prod/supervisord/supervisord.conf $SUPERVISORD_CONF_DIR/supervisord.conf

# Used to check that PHP-FPM works
HEALTHCHECK --interval=5s --timeout=3s
CMD curl -f http://localhost/ping || exit 1

# Production build
FROM base as production

COPY docker/prod/nginx/conf/test.conf $NGINX_DIR/conf.d/test.conf

WORKDIR $APP_DIR

COPY . .

# The vendors are installed after the whole project is copied, this way, we can dump the autoload properly.
# The unrequired directories are also removed.
RUN /bin/bash "$BUILD_SCRIPTS_DIR/install_composer.sh"
&& /bin/bash "$BUILD_SCRIPTS_DIR/composer_dependencies.sh"
&& rm -rf $BUILD_SCRIPTS_DIR
/usr/bin/git*
/lib/apk/db/installed
/usr/local/bin/composer
node_modules/

EXPOSE $APP_PORT 443

CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]


The image can be built without gcsfuse but when the build use:



gcsfuse mybucketname $APP_DIR



Here's the error that I encounter:



fusermount: fuse device not found, try 'modprobe fuse' first



Is there any workaround to get it working during docker build?



Thanks for the support










share|improve this question




























    0















    I try to use gcsfuse in order to store application source code on a GCP bucket, here's my Dockerfile:



    ARG VERSION

    FROM golang:1.12.5-alpine3.9 as gcsfuse-builder

    ENV GOPATH /go

    RUN apk --update add git=2.20.1-r0 fuse=2.9.8-r2 fuse-dev=2.9.8-r2
    && go get -u github.com/googlecloudplatform/gcsfuse

    FROM php:$VERSION as base

    ARG REVISION

    ENV APP_DIR=/srv/app
    APP_ENV=prod
    APP_FRONT_CONTROLLER=index.php
    APP_LOCALE=fr
    APP_USER=test-user
    APP_USER_GROUP=test
    APP_PORT=8080
    COMPOSER_ALLOW_SUPERUSER=1
    NGINX_DIR=/etc/nginx
    NGINX_VERSION=1.14.2-r1
    PHP_FPM_CONF_DIR=/usr/local/etc/php-fpm.d/
    SUPERVISORD_CONF_DIR=/etc/supervisor
    SUPERVISOR_VERSION=3.3.4-r1
    BUILD_SCRIPTS_DIR=/build-scripts
    GOOGLE_APPLICATION_CREDENTIALS=/srv/app/bucket.json

    # Supervisord conf to be copied at the end.
    COPY docker/prod/php/scripts/*.sh $BUILD_SCRIPTS_DIR/

    # Core dependencies installation (installed as a virtual package in order to remove it later)
    RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS
    && apk add --no-cache --virtual .fuse-deps curl sshfs fuse
    && apk add --no-cache --virtual .bash bash=4.4.19-r1
    && apk add --no-cache --virtual .core-php-deps icu-dev=62.1-r0
    && rm -rf /var/cache/apk/*
    && docker-php-ext-install
    intl
    opcache
    && docker-php-ext-configure intl
    && docker-php-ext-enable opcache
    && apk del .build-deps .phpize-deps-configure

    # User creation
    RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted --virtual .user-deps gosu=1.10-r0
    && rm -rf /var/cache/apk/*
    && addgroup $APP_USER_GROUP
    && adduser -D -h /home/portfolio -s /bin/bash -G $APP_USER_GROUP $APP_USER
    && chown -R $APP_USER $BUILD_SCRIPTS_DIR
    && apk del .user-deps

    # Nginx & Supervisor installation
    RUN apk add --no-cache --virtual .http-deps nginx=$NGINX_VERSION supervisor=$SUPERVISOR_VERSION
    && rm -rf /var/cache/apk/*
    && ln -sf /dev/stdout /var/log/nginx/access.log
    && ln -sf /dev/stderr /var/log/nginx/error.log

    # Filesystem (gcsfuse)
    COPY --from=gcsfuse-builder /go/bin/gcsfuse /usr/local/bin
    COPY bucket.json $APP_DIR/bucket.json

    # Filesystem (gcsfuse binding)
    RUN apk add --no-cache --virtual .filesystem-deps curl fuse fuse-dev rsync
    && mkdir -p $APP_DIR $BUILD_SCRIPTS_DIR
    && chown -R $APP_USER $APP_DIR
    && chmod -R 755 $APP_DIR
    && gcsfuse mybucketname $APP_DIR

    COPY docker/prod/php/conf/php.ini $PHP_INI_DIR/php.ini
    COPY docker/prod/php/conf/fpm.conf $PHP_FPM_CONF_DIR/fpm.conf
    COPY docker/prod/nginx/conf/nginx.conf $NGINX_DIR/nginx.conf
    COPY docker/prod/supervisord/supervisord.conf $SUPERVISORD_CONF_DIR/supervisord.conf

    # Used to check that PHP-FPM works
    HEALTHCHECK --interval=5s --timeout=3s
    CMD curl -f http://localhost/ping || exit 1

    # Production build
    FROM base as production

    COPY docker/prod/nginx/conf/test.conf $NGINX_DIR/conf.d/test.conf

    WORKDIR $APP_DIR

    COPY . .

    # The vendors are installed after the whole project is copied, this way, we can dump the autoload properly.
    # The unrequired directories are also removed.
    RUN /bin/bash "$BUILD_SCRIPTS_DIR/install_composer.sh"
    && /bin/bash "$BUILD_SCRIPTS_DIR/composer_dependencies.sh"
    && rm -rf $BUILD_SCRIPTS_DIR
    /usr/bin/git*
    /lib/apk/db/installed
    /usr/local/bin/composer
    node_modules/

    EXPOSE $APP_PORT 443

    CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]


    The image can be built without gcsfuse but when the build use:



    gcsfuse mybucketname $APP_DIR



    Here's the error that I encounter:



    fusermount: fuse device not found, try 'modprobe fuse' first



    Is there any workaround to get it working during docker build?



    Thanks for the support










    share|improve this question
























      0












      0








      0








      I try to use gcsfuse in order to store application source code on a GCP bucket, here's my Dockerfile:



      ARG VERSION

      FROM golang:1.12.5-alpine3.9 as gcsfuse-builder

      ENV GOPATH /go

      RUN apk --update add git=2.20.1-r0 fuse=2.9.8-r2 fuse-dev=2.9.8-r2
      && go get -u github.com/googlecloudplatform/gcsfuse

      FROM php:$VERSION as base

      ARG REVISION

      ENV APP_DIR=/srv/app
      APP_ENV=prod
      APP_FRONT_CONTROLLER=index.php
      APP_LOCALE=fr
      APP_USER=test-user
      APP_USER_GROUP=test
      APP_PORT=8080
      COMPOSER_ALLOW_SUPERUSER=1
      NGINX_DIR=/etc/nginx
      NGINX_VERSION=1.14.2-r1
      PHP_FPM_CONF_DIR=/usr/local/etc/php-fpm.d/
      SUPERVISORD_CONF_DIR=/etc/supervisor
      SUPERVISOR_VERSION=3.3.4-r1
      BUILD_SCRIPTS_DIR=/build-scripts
      GOOGLE_APPLICATION_CREDENTIALS=/srv/app/bucket.json

      # Supervisord conf to be copied at the end.
      COPY docker/prod/php/scripts/*.sh $BUILD_SCRIPTS_DIR/

      # Core dependencies installation (installed as a virtual package in order to remove it later)
      RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS
      && apk add --no-cache --virtual .fuse-deps curl sshfs fuse
      && apk add --no-cache --virtual .bash bash=4.4.19-r1
      && apk add --no-cache --virtual .core-php-deps icu-dev=62.1-r0
      && rm -rf /var/cache/apk/*
      && docker-php-ext-install
      intl
      opcache
      && docker-php-ext-configure intl
      && docker-php-ext-enable opcache
      && apk del .build-deps .phpize-deps-configure

      # User creation
      RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted --virtual .user-deps gosu=1.10-r0
      && rm -rf /var/cache/apk/*
      && addgroup $APP_USER_GROUP
      && adduser -D -h /home/portfolio -s /bin/bash -G $APP_USER_GROUP $APP_USER
      && chown -R $APP_USER $BUILD_SCRIPTS_DIR
      && apk del .user-deps

      # Nginx & Supervisor installation
      RUN apk add --no-cache --virtual .http-deps nginx=$NGINX_VERSION supervisor=$SUPERVISOR_VERSION
      && rm -rf /var/cache/apk/*
      && ln -sf /dev/stdout /var/log/nginx/access.log
      && ln -sf /dev/stderr /var/log/nginx/error.log

      # Filesystem (gcsfuse)
      COPY --from=gcsfuse-builder /go/bin/gcsfuse /usr/local/bin
      COPY bucket.json $APP_DIR/bucket.json

      # Filesystem (gcsfuse binding)
      RUN apk add --no-cache --virtual .filesystem-deps curl fuse fuse-dev rsync
      && mkdir -p $APP_DIR $BUILD_SCRIPTS_DIR
      && chown -R $APP_USER $APP_DIR
      && chmod -R 755 $APP_DIR
      && gcsfuse mybucketname $APP_DIR

      COPY docker/prod/php/conf/php.ini $PHP_INI_DIR/php.ini
      COPY docker/prod/php/conf/fpm.conf $PHP_FPM_CONF_DIR/fpm.conf
      COPY docker/prod/nginx/conf/nginx.conf $NGINX_DIR/nginx.conf
      COPY docker/prod/supervisord/supervisord.conf $SUPERVISORD_CONF_DIR/supervisord.conf

      # Used to check that PHP-FPM works
      HEALTHCHECK --interval=5s --timeout=3s
      CMD curl -f http://localhost/ping || exit 1

      # Production build
      FROM base as production

      COPY docker/prod/nginx/conf/test.conf $NGINX_DIR/conf.d/test.conf

      WORKDIR $APP_DIR

      COPY . .

      # The vendors are installed after the whole project is copied, this way, we can dump the autoload properly.
      # The unrequired directories are also removed.
      RUN /bin/bash "$BUILD_SCRIPTS_DIR/install_composer.sh"
      && /bin/bash "$BUILD_SCRIPTS_DIR/composer_dependencies.sh"
      && rm -rf $BUILD_SCRIPTS_DIR
      /usr/bin/git*
      /lib/apk/db/installed
      /usr/local/bin/composer
      node_modules/

      EXPOSE $APP_PORT 443

      CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]


      The image can be built without gcsfuse but when the build use:



      gcsfuse mybucketname $APP_DIR



      Here's the error that I encounter:



      fusermount: fuse device not found, try 'modprobe fuse' first



      Is there any workaround to get it working during docker build?



      Thanks for the support










      share|improve this question














      I try to use gcsfuse in order to store application source code on a GCP bucket, here's my Dockerfile:



      ARG VERSION

      FROM golang:1.12.5-alpine3.9 as gcsfuse-builder

      ENV GOPATH /go

      RUN apk --update add git=2.20.1-r0 fuse=2.9.8-r2 fuse-dev=2.9.8-r2
      && go get -u github.com/googlecloudplatform/gcsfuse

      FROM php:$VERSION as base

      ARG REVISION

      ENV APP_DIR=/srv/app
      APP_ENV=prod
      APP_FRONT_CONTROLLER=index.php
      APP_LOCALE=fr
      APP_USER=test-user
      APP_USER_GROUP=test
      APP_PORT=8080
      COMPOSER_ALLOW_SUPERUSER=1
      NGINX_DIR=/etc/nginx
      NGINX_VERSION=1.14.2-r1
      PHP_FPM_CONF_DIR=/usr/local/etc/php-fpm.d/
      SUPERVISORD_CONF_DIR=/etc/supervisor
      SUPERVISOR_VERSION=3.3.4-r1
      BUILD_SCRIPTS_DIR=/build-scripts
      GOOGLE_APPLICATION_CREDENTIALS=/srv/app/bucket.json

      # Supervisord conf to be copied at the end.
      COPY docker/prod/php/scripts/*.sh $BUILD_SCRIPTS_DIR/

      # Core dependencies installation (installed as a virtual package in order to remove it later)
      RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS
      && apk add --no-cache --virtual .fuse-deps curl sshfs fuse
      && apk add --no-cache --virtual .bash bash=4.4.19-r1
      && apk add --no-cache --virtual .core-php-deps icu-dev=62.1-r0
      && rm -rf /var/cache/apk/*
      && docker-php-ext-install
      intl
      opcache
      && docker-php-ext-configure intl
      && docker-php-ext-enable opcache
      && apk del .build-deps .phpize-deps-configure

      # User creation
      RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted --virtual .user-deps gosu=1.10-r0
      && rm -rf /var/cache/apk/*
      && addgroup $APP_USER_GROUP
      && adduser -D -h /home/portfolio -s /bin/bash -G $APP_USER_GROUP $APP_USER
      && chown -R $APP_USER $BUILD_SCRIPTS_DIR
      && apk del .user-deps

      # Nginx & Supervisor installation
      RUN apk add --no-cache --virtual .http-deps nginx=$NGINX_VERSION supervisor=$SUPERVISOR_VERSION
      && rm -rf /var/cache/apk/*
      && ln -sf /dev/stdout /var/log/nginx/access.log
      && ln -sf /dev/stderr /var/log/nginx/error.log

      # Filesystem (gcsfuse)
      COPY --from=gcsfuse-builder /go/bin/gcsfuse /usr/local/bin
      COPY bucket.json $APP_DIR/bucket.json

      # Filesystem (gcsfuse binding)
      RUN apk add --no-cache --virtual .filesystem-deps curl fuse fuse-dev rsync
      && mkdir -p $APP_DIR $BUILD_SCRIPTS_DIR
      && chown -R $APP_USER $APP_DIR
      && chmod -R 755 $APP_DIR
      && gcsfuse mybucketname $APP_DIR

      COPY docker/prod/php/conf/php.ini $PHP_INI_DIR/php.ini
      COPY docker/prod/php/conf/fpm.conf $PHP_FPM_CONF_DIR/fpm.conf
      COPY docker/prod/nginx/conf/nginx.conf $NGINX_DIR/nginx.conf
      COPY docker/prod/supervisord/supervisord.conf $SUPERVISORD_CONF_DIR/supervisord.conf

      # Used to check that PHP-FPM works
      HEALTHCHECK --interval=5s --timeout=3s
      CMD curl -f http://localhost/ping || exit 1

      # Production build
      FROM base as production

      COPY docker/prod/nginx/conf/test.conf $NGINX_DIR/conf.d/test.conf

      WORKDIR $APP_DIR

      COPY . .

      # The vendors are installed after the whole project is copied, this way, we can dump the autoload properly.
      # The unrequired directories are also removed.
      RUN /bin/bash "$BUILD_SCRIPTS_DIR/install_composer.sh"
      && /bin/bash "$BUILD_SCRIPTS_DIR/composer_dependencies.sh"
      && rm -rf $BUILD_SCRIPTS_DIR
      /usr/bin/git*
      /lib/apk/db/installed
      /usr/local/bin/composer
      node_modules/

      EXPOSE $APP_PORT 443

      CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]


      The image can be built without gcsfuse but when the build use:



      gcsfuse mybucketname $APP_DIR



      Here's the error that I encounter:



      fusermount: fuse device not found, try 'modprobe fuse' first



      Is there any workaround to get it working during docker build?



      Thanks for the support







      docker google-cloud-platform gcsfuse alpine






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 23 at 18:21









      GuikingoneGuikingone

      1




      1




















          2 Answers
          2






          active

          oldest

          votes


















          0














          Install gcsfuse only in build phase. Put the gcsfuse mount part in script and use the script in CMD.



          Then run your container with --privileged






          share|improve this answer























          • I can't run it with --privileged as my container is executed in Cloud Run :)

            – Guikingone
            May 29 at 17:43


















          0














          You must expose /dev/fuse from the command line or from docker-compose.yml and set privileged:



          myproject:
          privileged: true
          devices:
          - "/dev/fuse:/dev/fuse"


          My Dockerfile adapted from Ernest's docker-gcsfuse:



          FROM golang:alpine AS builder
          ARG GCSFUSE_VERSION=0.27.0
          RUN apk --update --no-cache add git fuse fuse-dev;
          RUN go get -d github.com/googlecloudplatform/gcsfuse
          RUN go install github.com/googlecloudplatform/gcsfuse/tools/build_gcsfuse
          RUN build_gcsfuse $GOPATH/src/github.com/googlecloudplatform/gcsfuse /tmp $GCSFUSE_VERSION

          COPY --from=builder /tmp/bin/gcsfuse /usr/bin
          COPY --from=builder /tmp/sbin/mount.gcsfuse /usr/sbin
          RUN ln -s /usr/sbin/mount.gcsfuse /usr/sbin/mount.fuse.gcsfuse
          WORKDIR /


          Mount through fstab (key_file is optional):



          echo "$BUCKET $MOUNTPOINT gcsfuse rw,user,noauto,key_file=$KEYFILE_PATH" >> /etc/fstab
          mount.gcsfuse $BUCKET $MOUNTPOINT





          share|improve this answer

























          • Thanks for the feedback, I've checked this and it seems that I cannot run gcsfuse my-bucket filespath during the docker build phase :/

            – Guikingone
            May 28 at 17:58











          • I updated the answer as implemented at my own project and works. You can obtain your key file (in json format) at the Service Account settings.

            – Amitie 10g
            May 28 at 21:02











          • I've followed your code and tried to use the gcsfuse command during docker build, it seems that using the mount.gcsfuse isn't possible as the executable isn't found :/

            – Guikingone
            Jun 2 at 15:39











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "2"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968611%2fgcsfuse-on-alpine-docker%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Install gcsfuse only in build phase. Put the gcsfuse mount part in script and use the script in CMD.



          Then run your container with --privileged






          share|improve this answer























          • I can't run it with --privileged as my container is executed in Cloud Run :)

            – Guikingone
            May 29 at 17:43















          0














          Install gcsfuse only in build phase. Put the gcsfuse mount part in script and use the script in CMD.



          Then run your container with --privileged






          share|improve this answer























          • I can't run it with --privileged as my container is executed in Cloud Run :)

            – Guikingone
            May 29 at 17:43













          0












          0








          0







          Install gcsfuse only in build phase. Put the gcsfuse mount part in script and use the script in CMD.



          Then run your container with --privileged






          share|improve this answer













          Install gcsfuse only in build phase. Put the gcsfuse mount part in script and use the script in CMD.



          Then run your container with --privileged







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 24 at 0:14









          Cloud AceCloud Ace

          1967




          1967












          • I can't run it with --privileged as my container is executed in Cloud Run :)

            – Guikingone
            May 29 at 17:43

















          • I can't run it with --privileged as my container is executed in Cloud Run :)

            – Guikingone
            May 29 at 17:43
















          I can't run it with --privileged as my container is executed in Cloud Run :)

          – Guikingone
          May 29 at 17:43





          I can't run it with --privileged as my container is executed in Cloud Run :)

          – Guikingone
          May 29 at 17:43













          0














          You must expose /dev/fuse from the command line or from docker-compose.yml and set privileged:



          myproject:
          privileged: true
          devices:
          - "/dev/fuse:/dev/fuse"


          My Dockerfile adapted from Ernest's docker-gcsfuse:



          FROM golang:alpine AS builder
          ARG GCSFUSE_VERSION=0.27.0
          RUN apk --update --no-cache add git fuse fuse-dev;
          RUN go get -d github.com/googlecloudplatform/gcsfuse
          RUN go install github.com/googlecloudplatform/gcsfuse/tools/build_gcsfuse
          RUN build_gcsfuse $GOPATH/src/github.com/googlecloudplatform/gcsfuse /tmp $GCSFUSE_VERSION

          COPY --from=builder /tmp/bin/gcsfuse /usr/bin
          COPY --from=builder /tmp/sbin/mount.gcsfuse /usr/sbin
          RUN ln -s /usr/sbin/mount.gcsfuse /usr/sbin/mount.fuse.gcsfuse
          WORKDIR /


          Mount through fstab (key_file is optional):



          echo "$BUCKET $MOUNTPOINT gcsfuse rw,user,noauto,key_file=$KEYFILE_PATH" >> /etc/fstab
          mount.gcsfuse $BUCKET $MOUNTPOINT





          share|improve this answer

























          • Thanks for the feedback, I've checked this and it seems that I cannot run gcsfuse my-bucket filespath during the docker build phase :/

            – Guikingone
            May 28 at 17:58











          • I updated the answer as implemented at my own project and works. You can obtain your key file (in json format) at the Service Account settings.

            – Amitie 10g
            May 28 at 21:02











          • I've followed your code and tried to use the gcsfuse command during docker build, it seems that using the mount.gcsfuse isn't possible as the executable isn't found :/

            – Guikingone
            Jun 2 at 15:39















          0














          You must expose /dev/fuse from the command line or from docker-compose.yml and set privileged:



          myproject:
          privileged: true
          devices:
          - "/dev/fuse:/dev/fuse"


          My Dockerfile adapted from Ernest's docker-gcsfuse:



          FROM golang:alpine AS builder
          ARG GCSFUSE_VERSION=0.27.0
          RUN apk --update --no-cache add git fuse fuse-dev;
          RUN go get -d github.com/googlecloudplatform/gcsfuse
          RUN go install github.com/googlecloudplatform/gcsfuse/tools/build_gcsfuse
          RUN build_gcsfuse $GOPATH/src/github.com/googlecloudplatform/gcsfuse /tmp $GCSFUSE_VERSION

          COPY --from=builder /tmp/bin/gcsfuse /usr/bin
          COPY --from=builder /tmp/sbin/mount.gcsfuse /usr/sbin
          RUN ln -s /usr/sbin/mount.gcsfuse /usr/sbin/mount.fuse.gcsfuse
          WORKDIR /


          Mount through fstab (key_file is optional):



          echo "$BUCKET $MOUNTPOINT gcsfuse rw,user,noauto,key_file=$KEYFILE_PATH" >> /etc/fstab
          mount.gcsfuse $BUCKET $MOUNTPOINT





          share|improve this answer

























          • Thanks for the feedback, I've checked this and it seems that I cannot run gcsfuse my-bucket filespath during the docker build phase :/

            – Guikingone
            May 28 at 17:58











          • I updated the answer as implemented at my own project and works. You can obtain your key file (in json format) at the Service Account settings.

            – Amitie 10g
            May 28 at 21:02











          • I've followed your code and tried to use the gcsfuse command during docker build, it seems that using the mount.gcsfuse isn't possible as the executable isn't found :/

            – Guikingone
            Jun 2 at 15:39













          0












          0








          0







          You must expose /dev/fuse from the command line or from docker-compose.yml and set privileged:



          myproject:
          privileged: true
          devices:
          - "/dev/fuse:/dev/fuse"


          My Dockerfile adapted from Ernest's docker-gcsfuse:



          FROM golang:alpine AS builder
          ARG GCSFUSE_VERSION=0.27.0
          RUN apk --update --no-cache add git fuse fuse-dev;
          RUN go get -d github.com/googlecloudplatform/gcsfuse
          RUN go install github.com/googlecloudplatform/gcsfuse/tools/build_gcsfuse
          RUN build_gcsfuse $GOPATH/src/github.com/googlecloudplatform/gcsfuse /tmp $GCSFUSE_VERSION

          COPY --from=builder /tmp/bin/gcsfuse /usr/bin
          COPY --from=builder /tmp/sbin/mount.gcsfuse /usr/sbin
          RUN ln -s /usr/sbin/mount.gcsfuse /usr/sbin/mount.fuse.gcsfuse
          WORKDIR /


          Mount through fstab (key_file is optional):



          echo "$BUCKET $MOUNTPOINT gcsfuse rw,user,noauto,key_file=$KEYFILE_PATH" >> /etc/fstab
          mount.gcsfuse $BUCKET $MOUNTPOINT





          share|improve this answer















          You must expose /dev/fuse from the command line or from docker-compose.yml and set privileged:



          myproject:
          privileged: true
          devices:
          - "/dev/fuse:/dev/fuse"


          My Dockerfile adapted from Ernest's docker-gcsfuse:



          FROM golang:alpine AS builder
          ARG GCSFUSE_VERSION=0.27.0
          RUN apk --update --no-cache add git fuse fuse-dev;
          RUN go get -d github.com/googlecloudplatform/gcsfuse
          RUN go install github.com/googlecloudplatform/gcsfuse/tools/build_gcsfuse
          RUN build_gcsfuse $GOPATH/src/github.com/googlecloudplatform/gcsfuse /tmp $GCSFUSE_VERSION

          COPY --from=builder /tmp/bin/gcsfuse /usr/bin
          COPY --from=builder /tmp/sbin/mount.gcsfuse /usr/sbin
          RUN ln -s /usr/sbin/mount.gcsfuse /usr/sbin/mount.fuse.gcsfuse
          WORKDIR /


          Mount through fstab (key_file is optional):



          echo "$BUCKET $MOUNTPOINT gcsfuse rw,user,noauto,key_file=$KEYFILE_PATH" >> /etc/fstab
          mount.gcsfuse $BUCKET $MOUNTPOINT






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 28 at 20:59

























          answered May 24 at 0:15









          Amitie 10gAmitie 10g

          185




          185












          • Thanks for the feedback, I've checked this and it seems that I cannot run gcsfuse my-bucket filespath during the docker build phase :/

            – Guikingone
            May 28 at 17:58











          • I updated the answer as implemented at my own project and works. You can obtain your key file (in json format) at the Service Account settings.

            – Amitie 10g
            May 28 at 21:02











          • I've followed your code and tried to use the gcsfuse command during docker build, it seems that using the mount.gcsfuse isn't possible as the executable isn't found :/

            – Guikingone
            Jun 2 at 15:39

















          • Thanks for the feedback, I've checked this and it seems that I cannot run gcsfuse my-bucket filespath during the docker build phase :/

            – Guikingone
            May 28 at 17:58











          • I updated the answer as implemented at my own project and works. You can obtain your key file (in json format) at the Service Account settings.

            – Amitie 10g
            May 28 at 21:02











          • I've followed your code and tried to use the gcsfuse command during docker build, it seems that using the mount.gcsfuse isn't possible as the executable isn't found :/

            – Guikingone
            Jun 2 at 15:39
















          Thanks for the feedback, I've checked this and it seems that I cannot run gcsfuse my-bucket filespath during the docker build phase :/

          – Guikingone
          May 28 at 17:58





          Thanks for the feedback, I've checked this and it seems that I cannot run gcsfuse my-bucket filespath during the docker build phase :/

          – Guikingone
          May 28 at 17:58













          I updated the answer as implemented at my own project and works. You can obtain your key file (in json format) at the Service Account settings.

          – Amitie 10g
          May 28 at 21:02





          I updated the answer as implemented at my own project and works. You can obtain your key file (in json format) at the Service Account settings.

          – Amitie 10g
          May 28 at 21:02













          I've followed your code and tried to use the gcsfuse command during docker build, it seems that using the mount.gcsfuse isn't possible as the executable isn't found :/

          – Guikingone
          Jun 2 at 15:39





          I've followed your code and tried to use the gcsfuse command during docker build, it seems that using the mount.gcsfuse isn't possible as the executable isn't found :/

          – Guikingone
          Jun 2 at 15:39

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968611%2fgcsfuse-on-alpine-docker%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

          Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

          Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020