{"id":18510799,"url":"https://github.com/envato/docker-cache-buildkite-plugin","last_synced_at":"2025-05-14T11:19:44.836Z","repository":{"id":66244761,"uuid":"426064735","full_name":"envato/docker-cache-buildkite-plugin","owner":"envato","description":"Build a multi-stage compatible cache image and store it in S3","archived":false,"fork":false,"pushed_at":"2021-12-08T01:55:19.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":51,"default_branch":"main","last_synced_at":"2025-05-14T11:19:11.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/envato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-11-09T02:28:47.000Z","updated_at":"2024-04-06T18:50:16.000Z","dependencies_parsed_at":"2023-07-21T20:10:54.462Z","dependency_job_id":null,"html_url":"https://github.com/envato/docker-cache-buildkite-plugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fdocker-cache-buildkite-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fdocker-cache-buildkite-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fdocker-cache-buildkite-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fdocker-cache-buildkite-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/envato","download_url":"https://codeload.github.com/envato/docker-cache-buildkite-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129636,"owners_count":22019632,"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":[],"created_at":"2024-11-06T15:25:10.814Z","updated_at":"2025-05-14T11:19:44.815Z","avatar_url":"https://github.com/envato.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Cache Buildkite Plugin\n\nA [Buildkite plugin](https://buildkite.com/docs/agent/v3/plugins) that lets you build docker images suitable for use as a cache in multi-stage builds and stores them in S3.\n\nThe current [Docker Compose Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin) doesn't support building with `buildx` command, which creates images with a cache manifest.\nAt the time of writing [ECR does not support cache manifests](https://github.com/aws/containers-roadmap/issues/876).\n\n## Example\n\nThe following pipeline will retrieve an image from S3 for use as a cache for building an image.\nOn `main` branch builds it will also push the latest image back to S3.\n\nSetting the metadata key to something compatible with the [Docker Compose Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin) allows using that plugin for test steps and the pre-built image automatically downloads.\n\n```yml\n  - label: ':whale: build ruby container'\n    env:\n      DOCKER_BUILDKIT: 1\n      BUILDKIT_PROGRESS: plain\n    plugins:\n      - ecr#v1.2.0:\n          region: us-east-1\n          account-ids: 012345678910\n      - docker-cache#v0.0.1:\n          s3_bucket: example-bucket\n          s3_key: ${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_COMMIT}\n          image_repository: 012345678910.dkr.ecr.us-east-1.amazonaws.com/my-ruby-image\n          image_name: ${BUILDKITE_COMMIT}\n          # This ensures docker-compose plugin will automatically find the image\n          metadata_key: docker-compose-plugin-built-image-tag-ruby\n  - wait\n  # Do some testing\n  - label: ':whale: update image cache'\n    branches: main\n    env:\n      DOCKER_BUILDKIT: 1\n      BUILDKIT_PROGRESS: plain\n    plugins:\n      - ecr#v1.2.0:\n          region: us-east-1\n          account-ids: 012345678910\n      - docker-cache#v0.0.1:\n          s3_bucket: example-bucket\n          s3_key: ${BUILDKITE_PIPELINE_SLUG}/latest\n          metadata_key: docker-cache-image-ruby\n```\n\n## Configuration\n\n### `s3_bucket`\n\nThe S3 bucket to store images in.\n\n### `s3_key`\n\nThe name to give the file we upload to S3.\n\n### `metadata_key`\n\nWhere to find/store the s3 key we download the cache image from, using [Buildkite Metadata](https://buildkite.com/docs/agent/v3/cli-meta-data).\n\n### `service` (optional)\n\nThe name of the service to build from docker-compose.\n\n### `config` (optional)\n\nThe file name of the Docker Compose configuration file to use. Can also be a list of filenames. If `$COMPOSE_FILE` is set, it will be used if `config` is not specified.\n\nDefault: `docker-compose.yml`\n\n### `cache_from` (optional)\n\nThe name of the s3 location to download a cache from before building.\n\nDefault: `${BUILDKITE_PIPELINE_SLUG}/latest`\n\n### `image_repository` (optional)\n\nIf present we build an image from the cache and push it to this image repo.\n\n### `image_name` (optional)\n\nThe tag we give to the image when pushing to a repo\n\nDefault: `${BUILDKITE_COMMIT}`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvato%2Fdocker-cache-buildkite-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvato%2Fdocker-cache-buildkite-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvato%2Fdocker-cache-buildkite-plugin/lists"}