Install GCS FUSE in Google Cloud Container Optimized OS (COS)

306 views Asked by At

Could you please provide the commands to install gcsfuse in Google Cloud Container Optimized OS (COS) and mount a bucket? Also I'm not sure which would be recommended, doing it directly on OS or on the container.

I came across this command here

docker run --privileged -v /mnt/disks/bucket:/bucket --device /dev/fuse my_gcsfuse /go/bin/gcsfuse -o allow_other <BUCKET> /bucket

Is this the way to install and mount a bucket in Google Cloud Container Optimized OS (COS) at container level?

2

There are 2 answers

0
yan-hic On

Here 4 options that you may want to consider:

  1. running docker from within a container (aka DIND) on COS is perfectly possible as you did, but read the answer for the link you posted, you must add a flag for the mount to work e2e
  2. DIND is not really installing. If you really want to install, you can refer to a hack I used to install docker-compose and follow the installation instructions for gcsfuse
  3. you could use Cloud Run instead, and configure your my_gcsfuse (or use the latest official Dockerfile) as a sidecar container. Sidecar and main containers use shared volumes
  4. if you use a custom image, merge both Dockerfiles - see the builder base image to copy the gcsfuse executable from - and use the new image to run on COS

The last option has my preference.

0
Tulsi Shah On

GCSFuse currently does not support Google Cloud Container Optimized OS (COS).

Please refer here to know more