{"id":16928625,"url":"https://github.com/peterjclaw/lazy-docker-build-push-action","last_synced_at":"2026-05-08T18:35:49.031Z","repository":{"id":240414015,"uuid":"802512343","full_name":"PeterJCLaw/lazy-docker-build-push-action","owner":"PeterJCLaw","description":"Lazily build Docker images to content-identifying-hash based tags.","archived":false,"fork":false,"pushed_at":"2024-05-20T18:45:01.000Z","size":38,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T02:43:00.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/PeterJCLaw.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":"2024-05-18T13:58:48.000Z","updated_at":"2024-05-20T18:44:08.000Z","dependencies_parsed_at":"2024-05-20T20:11:39.304Z","dependency_job_id":null,"html_url":"https://github.com/PeterJCLaw/lazy-docker-build-push-action","commit_stats":null,"previous_names":["peterjclaw/lazy-docker-build-push-action"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/PeterJCLaw/lazy-docker-build-push-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterJCLaw%2Flazy-docker-build-push-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterJCLaw%2Flazy-docker-build-push-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterJCLaw%2Flazy-docker-build-push-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterJCLaw%2Flazy-docker-build-push-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterJCLaw","download_url":"https://codeload.github.com/PeterJCLaw/lazy-docker-build-push-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterJCLaw%2Flazy-docker-build-push-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32792422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-13T20:37:15.603Z","updated_at":"2026-05-08T18:35:49.009Z","avatar_url":"https://github.com/PeterJCLaw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lazy-docker-build-push-action\n\nLazily build Docker images to content-identifying-hash based tags.\n\nThis aims to speed up build times by avoiding expensive rebuilding of\nslow-moving layers, such as those containing external dependencies. While Docker\nlayer caching can achieve this in some cases, doing so requires storing and\nloading the relevant caches which can prove almost as time consuming as\nrebuilding the layers. This Action uses stable hashing of inputs to achieve\nspeed-ups without full caching.\n\nThe actual Docker build is handled by [`docker/build-push-action`][docker-bpa]\nand the majority of the action's arguments are passed directly to that action.\n\nThe following are automatically included in the identifying hash:\n\n* Annotations\n* Attestation, provenance and SBOM\n* Build args\n* Build cgroup-parent and ulimit\n* Build contexts\n* Build target\n* Labels\n* the Dockerfile itself (no attempt is made to parse it)\n\nAny other inputs (including e.g: files referenced in `COPY` statements) **must\nbe specified manually**.\n\nTags for the built image are inferred automatically from those passed. For each\ninput tag, the image name is extracted and a tag name of the form\n`content-hash-\u003chash\u003e` is appended, so `user/app:latest` would additionally be\ntagged as `user/app:content-hash-1234abc...`.\n\nHashes are stable for given inputs when using a pinned version of this Action.\nCounterexamples to this are considered bugs. While effort will be made to\nmaintain hash stability, new releases may include changes to the hash. Since\nthis Action is in effect a cache, such changes will not be considered breaking.\n\nArguments:\n\n* `tags` (required): A list of image names (`user/app`) or full tags\n  (`user/app:latest`) to apply to the resulting image. Passed through to\n  `docker/build-push-action` with the content-identifying tags applied.\n\n* `pull` or `load`: If either of these are set to `true` then any existing image\n  matching the computed hash will be made available locally. Otherwise the\n  action will attempt to avoid fetching images unless a build is needed.\n\n  **TODO**: implement this.\n\n* `extra-inputs` (optional): A list of globs of files to include in the content\n  hash.\n\nOther arguments to `docker/build-push-action` are passed through unchanged.\n\nOutputs:\n\n* `image-name`: The name of the image (e.g: `user/app`), reflected from the\n  parsed `tags` input for convenience. Where several names are encountered, this\n  is the first from the list for which the desired image (now) exists.\n\n  **TODO**: implement handling for one of the names not existing\n\n* `image-tag`: The tag of the image (e.g: `content-hash-1234abc...`), as\n  constructed from the hashed inputs.\n\n* `image-name-tag`: The full name of the image, `\u003cimage-name\u003e:\u003cimage-tag\u003e` (e.g:\n  `user/app:content-hash-1234abc...`), for convenience.\n\n* `tag-existed`: Whether or not the tag already existed (for any of the input\n  names) and thus whether or not a build occurred.\n\nExample usage:\n\n```yaml\non:\n  push:\n    branches:\n      - main\n\njobs:\n  docker:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Login to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKERHUB_USERNAME }}\n          password: ${{ secrets.DOCKERHUB_TOKEN }}\n\n      - name: Build base layer\n        uses: PeterJCLaw/lazy-docker-build-push-action@v0.2\n        id: build-base\n        with:\n          context: .\n          push: true\n          tags: user/base:latest\n          extra-inputs: requirements*.txt\n\n      - name: Build and push\n        uses: docker/build-push-action@v5\n        with:\n          context: .\n          push: true\n          tags: user/app:latest\n          build-args: |\n            BASE_IMAGE=${{ steps.build-base.outputs.image-name-tag }}\n```\n\nSee also the [examples](./examples/) directory.\n\n[docker-bpa]: https://github.com/marketplace/actions/build-and-push-docker-images\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterjclaw%2Flazy-docker-build-push-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterjclaw%2Flazy-docker-build-push-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterjclaw%2Flazy-docker-build-push-action/lists"}