{"id":13588043,"url":"https://github.com/elementar/docker-s3-volume","last_synced_at":"2025-04-08T02:34:37.034Z","repository":{"id":20227037,"uuid":"23498877","full_name":"elementar/docker-s3-volume","owner":"elementar","description":"Docker container with a data volume from s3.","archived":false,"fork":false,"pushed_at":"2024-03-28T07:42:17.000Z","size":27,"stargazers_count":276,"open_issues_count":6,"forks_count":69,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-04T22:33:57.565Z","etag":null,"topics":["aws","backup","docker","docker-compose","s3","sync","volume"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elementar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-30T19:16:09.000Z","updated_at":"2025-02-17T13:08:39.000Z","dependencies_parsed_at":"2024-11-06T07:33:16.211Z","dependency_job_id":"64d07af1-5a4f-4d2c-a1cf-43bded50e245","html_url":"https://github.com/elementar/docker-s3-volume","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/elementar%2Fdocker-s3-volume","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementar%2Fdocker-s3-volume/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementar%2Fdocker-s3-volume/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementar%2Fdocker-s3-volume/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elementar","download_url":"https://codeload.github.com/elementar/docker-s3-volume/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247765103,"owners_count":20992236,"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":["aws","backup","docker","docker-compose","s3","sync","volume"],"created_at":"2024-08-01T15:06:28.842Z","updated_at":"2025-04-08T02:34:36.794Z","avatar_url":"https://github.com/elementar.png","language":"Shell","funding_links":[],"categories":["HarmonyOS","Shell","docker"],"sub_categories":["Windows Manager"],"readme":"# docker-s3-volume\n\n[![Docker Build Status](https://img.shields.io/docker/build/elementar/s3-volume?style=plastic)](https://hub.docker.com/r/elementar/s3-volume)\n[![Docker Layers Count](https://img.shields.io/microbadger/layers/elementar/s3-volume?style=plastic)](https://hub.docker.com/r/elementar/s3-volume)\n[![Docker Version](https://img.shields.io/docker/v/elementar/s3-volume?style=plastic)](https://hub.docker.com/r/elementar/s3-volume)\n[![Docker Pull Count](https://img.shields.io/docker/pulls/elementar/s3-volume?style=plastic)](https://hub.docker.com/r/elementar/s3-volume)\n[![Docker Stars](https://img.shields.io/docker/stars/elementar/s3-volume?style=plastic)](https://hub.docker.com/r/elementar/s3-volume)\n\nCreates a Docker container that is restored and backed up to a directory on s3.\nYou could use this to run short lived processes that work with and persist data to and from S3.\n\n## Usage\n\nFor the simplest usage, you can just start the data container:\n\n```bash\ndocker run -d --name my-data-container \\\n           elementar/s3-volume /data s3://mybucket/someprefix\n```\n\nThis will download the data from the S3 location you specify into the\ncontainer's `/data` directory. When the container shuts down, the data will be\nsynced back to S3.\n\nTo use the data from another container, you can use the `--volumes-from` option:\n\n```bash\ndocker run -it --rm --volumes-from=my-data-container busybox ls -l /data\n```\n\n### Configuring a sync interval\n\nWhen the `BACKUP_INTERVAL` environment variable is set, a watcher process will\nsync the `/data` directory to S3 on the interval you specify. The interval can\nbe specified in seconds, minutes, hours or days (adding `s`, `m`, `h` or `d` as\nthe suffix):\n\n```bash\ndocker run -d --name my-data-container -e BACKUP_INTERVAL=2m \\\n           elementar/s3-volume /data s3://mybucket/someprefix\n```\n\n### Configuring credentials\n\nIf you are running on EC2, IAM role credentials should just work. Otherwise,\nyou can supply credential information using environment variables:\n\n```bash\ndocker run -d --name my-data-container \\\n           -e AWS_ACCESS_KEY_ID=... -e AWS_SECRET_ACCESS_KEY=... \\\n           elementar/s3-volume /data s3://mybucket/someprefix\n```\n\nAny environment variable available to the `aws-cli` command can be used. see\nhttp://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html for more\ninformation.\n\n### Configuring an endpoint URL\n\nIf you are using an S3-compatible service (such as Oracle OCI Object Storage), you may want to set the service's endpoint URL:\n\n```bash\ndocker run -d --name my-data-container -e ENDPOINT_URL=... \\\n           elementar/s3-volume /data s3://mybucket/someprefix\n```\n\n### Forcing a sync\n\nA final sync will always be performed on container shutdown. A sync can be\nforced by sending the container the `USR1` signal:\n\n```bash\ndocker kill --signal=USR1 my-data-container\n```\n\n### Forcing a restoration\n\nThe first time the container is ran, it will fetch the contents of the S3\nlocation to initialize the `/data` directory. If you want to force an initial\nsync again, you can run the container again with the `--force-restore` option:\n\n```bash\ndocker run -d --name my-data-container \\\n           elementar/s3-volume --force-restore /data s3://mybucket/someprefix\n```\n\n### Deletion and sync\n\nBy default if there are files that are deleted in your local file system, those will be deleted remotely. If you wish to turn this off, set the environment variable `S3_SYNC_FLAGS` to an empty string:\n\n```bash\ndocker run -d -e S3_SYNC_FLAGS=\"\" elementar/s3-volume /data s3://mybucket/someprefix\n```\n\n### Using Compose and named volumes\n\nMost of the time, you will use this image to sync data for another container.\nYou can use `docker-compose` for that:\n\n```yaml\n# docker-compose.yaml\nversion: \"2\"\n\nvolumes:\n  s3data:\n    driver: local\n\nservices:\n  s3vol:\n    image: elementar/s3-volume\n    command: /data s3://mybucket/someprefix\n    volumes:\n      - s3data:/data\n  db:\n    image: postgres\n    volumes:\n      - s3data:/var/lib/postgresql/data\n```\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Credits\n\n* Original Developer - Dave Newman (@whatupdave)\n* Current Maintainer - Fábio Batista (@fabiob)\n\n## License\n\nThis repository is released under the MIT license:\n\n* www.opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felementar%2Fdocker-s3-volume","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felementar%2Fdocker-s3-volume","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felementar%2Fdocker-s3-volume/lists"}