Google Cloud Storage
Prerequisites
To use Google Cloud Storage, you’ll need a bucket and a service account. You can create a service account here and a bucket here. If you want to write to the bucket, make sure the service account has theStorage Object User
role for this bucket.
You can find a guide on creating a service account key here.
Mounting the bucket
To use the Google Cloud Storage we need to install thegcsfuse
package. There’s simple Dockerfile
that can be used to create a container with the gcsfuse
installed.
gcsfuse
command.
Flags
The complete list of flags is available here.Allow the default user to access the files
To allow the default user to access the files, we can use the following flags:Amazon S3
To use Amazon S3, we can use thes3fs
package. The Dockerfile
setup is similar to that of Google Cloud Storage.
s3fs
command is used to mount the bucket to the sandbox.
Flags
The complete list of flags is available here.Allow the default user to access the files
To allow the default user to access the files, add the following flag:Cloudflare R2
For Cloudflare R2, we can use a setup very similar to S3. TheDockerfile
remains the same as for S3. However, the mounting differs slightly; we need to specify the endpoint for R2.