{"id":13620059,"url":"https://github.com/ofek/docker-volume-gcs","last_synced_at":"2025-05-05T16:45:59.527Z","repository":{"id":53003441,"uuid":"183971708","full_name":"ofek/docker-volume-gcs","owner":"ofek","description":"Docker Volume Plugin for Google Cloud Storage","archived":false,"fork":false,"pushed_at":"2021-04-10T06:52:31.000Z","size":20,"stargazers_count":23,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T01:38:38.082Z","etag":null,"topics":["docker","fuse","google-cloud-storage","plugin"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ofek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-28T23:58:36.000Z","updated_at":"2024-05-07T05:28:37.000Z","dependencies_parsed_at":"2022-09-08T03:21:54.979Z","dependency_job_id":null,"html_url":"https://github.com/ofek/docker-volume-gcs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fdocker-volume-gcs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fdocker-volume-gcs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fdocker-volume-gcs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ofek%2Fdocker-volume-gcs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ofek","download_url":"https://codeload.github.com/ofek/docker-volume-gcs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252535698,"owners_count":21763995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","fuse","google-cloud-storage","plugin"],"created_at":"2024-08-01T21:00:51.701Z","updated_at":"2025-05-05T16:45:59.508Z","avatar_url":"https://github.com/ofek.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# gcsfs\n\n[![Travis CI](https://api.travis-ci.com/ofek/docker-volume-gcs.svg?branch=master)](https://travis-ci.com/ofek/docker-volume-gcs)\n[![Docker - Pulls](https://img.shields.io/docker/pulls/ofekmeister/gcsfs.svg)](https://hub.docker.com/r/ofekmeister/gcsfs)\n[![License - MIT/Apache-2.0](https://img.shields.io/badge/license-MIT%2FApache--2.0-9400d3.svg)](https://choosealicense.com/licenses)\n[![Say Thanks](https://img.shields.io/badge/say-thanks-ff69b4.svg)](https://saythanks.io/to/ofekmeister%40gmail.com)\n\n-----\n\nAn easy-to-use, cross-platform, and highly optimized Docker Volume Plugin for mounting Google Cloud Storage buckets.\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Standard](#standard)\n  - [Key mounting](#key-mounting)\n- [Driver options](#driver-options)\n- [Permission](#permission)\n- [License](#license)\n- [Credits](#credits)\n- [Future](#future)\n\n## Installation\n\n`gcsfs` is distributed on [Docker Hub](https://hub.docker.com/search), allowing a seamless install:\n\n```console\n$ docker plugin install ofekmeister/gcsfs\n```\n\nYou will also need at least one [service account key](#permission).\n\n## Usage\n\n### Standard\n\nCreate a volume with the key contents:\n\n```console\n$ docker volume create -d ofekmeister/gcsfs -o key=$(cat service_account_key_file) \u003cBUCKET_NAME\u003e\n```\n\nor via `docker-compose`:\n\n```yaml\nversion: '3.4'\n\nvolumes:\n  mybucket:\n    name: \u003cBUCKET_NAME\u003e\n    driver: ofekmeister/gcsfs\n    driver_opts:\n      key: ${KEY_CONTENTS_IN_ENV_VAR}\n```\n\nThen create a container that uses the volume:\n\n```console\n$ docker run -v \u003cBUCKET_NAME\u003e:/data --rm -d --name gcsfs-test alpine tail -f /dev/null\n```\n\nor via `docker-compose`:\n\n```yaml\nservices:\n  test:\n    container_name: gcsfs-test\n    image: alpine\n    entrypoint: ['tail', '-f', '/dev/null']\n    volumes:\n    - mybucket:/data\n```\n\nAt this point you should be able to access your bucket:\n\n```console\n$ docker exec gcsfs-test ls /data\n```\n\n### Key mounting\n\nAlternatively, you can mount a directory of service account keys and reference the file name.\n\nFirst disable the plugin:\n\n```console\n$ docker plugin disable ofekmeister/gcsfs\n```\n\nthen set the `keys.source` option:\n\n```console\n$ docker plugin set ofekmeister/gcsfs keys.source=/path/to/keys\n```\n\nIf you don't yet have the plugin, this can also be done during the installation:\n\n```console\n$ docker plugin install ofekmeister/gcsfs keys.source=/path/to/keys\n```\n\n**Note:** On Windows you'll need to use `host_mnt` paths e.g. `C:\\path\\to\\keys` would become `/host_mnt/c/path/to/keys`.\n\nAssuming there is a file named `credentials.json` in `/path/to/keys`, you can now create a volume by doing:\n\n```console\n$ docker volume create -d ofekmeister/gcsfs -o key=credentials.json \u003cBUCKET_NAME\u003e\n```\n\nor via `docker-compose`:\n\n```yaml\nversion: '3.4'\n\nvolumes:\n  mybucket:\n    name: \u003cBUCKET_NAME\u003e\n    driver: ofekmeister/gcsfs\n    driver_opts:\n      key: credentials.json\n```\n\n## Driver options\n\n- `key` - The file name of the key in the `keys.source` directory, or else the raw key contents if it doesn't exist.\n- `bucket` - The Google Cloud Storage bucket to use. If this is not specified, the volume name is assumed to be the desired bucket.\n- `flags` - Extra [flags](https://github.com/ofek/docker-volume-gcs/blob/master/gcsfuse_flags) to\n  pass to [gcsfuse][1] e.g. `-o flags=\"--limit-ops-per-sec=10 --only-dir=some/nested/folder\"`.\n- `debug` - A timeout (in seconds) used only for testing. This will attempt to mount the bucket, wait for logs, then un-mount and print debug info.\n\n## Permission\n\nIn order to access anything stored in Google Cloud Storage, you will need service accounts with appropriate IAM\nroles. Read more about them [here](https://cloud.google.com/iam/docs/understanding-service-accounts). If writes\nare needed, you will usually select `roles/storage.admin` scoped to the desired buckets.\n\nThe easiest way to create service account keys, if you don't yet have any, is to run:\n\n```console\n$ gcloud iam service-accounts list\n```\n\nto find the email of a desired service account, then run:\n\n```console\n$ gcloud iam service-accounts keys create \u003cFILE_NAME\u003e.json --iam-account \u003cEMAIL\u003e\n```\n\nto create a key file.\n\n**Tip:** If you have a service account with write access you want to share with containers that should only\nbe able to read, you can append the standard `:ro` to avoid creating a new read-only service account.\n\n## License\n\n`gcsfs` is distributed under the terms of both\n\n- [Apache License, Version 2.0](https://choosealicense.com/licenses/apache-2.0)\n- [MIT License](https://choosealicense.com/licenses/mit)\n\nat your option.\n\n## Credits\n\n- [gcsfuse](1)\n- [Brian Goff](https://github.com/cpuguy83) and [Justin Cormack](https://github.com/justincormack) for being helpful in Slack\n  and encouraging me to write this to overcome a [limitation on non-Linux hosts](https://github.com/moby/moby/issues/39093).\n\n## Kubernetes\n\nSee [csi-gcs](https://github.com/ofek/csi-gcs).\n\n[1]: https://github.com/GoogleCloudPlatform/gcsfuse\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofek%2Fdocker-volume-gcs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofek%2Fdocker-volume-gcs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofek%2Fdocker-volume-gcs/lists"}