Skip to content

GitHub Actions Cache - Docker Build #1345

Closed

Description

@ajithshah

This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP

ERROR: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset

ERROR: failed to solve: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset
Reference
Check build summary support

      - name: Docker Build and Push
        uses: docker/build-push-action@v6
        with:
          context: .
          file: ${{ inputs.dockerfile }}
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          platforms: ${{ inputs.docker_image_platforms }}
          build-args: |
            IMAGE_TAG=${{ steps.meta.outputs.tags }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
          github-token: ${{ secrets.TOKEN_GITHUB }}

Activity

  1. andrewhharmon commented on Apr 1, 2025

    @andrewhharmon

    is this indicating version 3.2.4 of actions/cache is being used and this indicates that it's deprecated?

    Editing this out, as I linked to the action instead of the node library

  2. newman-dani commented on Apr 1, 2025

    @newman-dani

    I was able to bypass the error by setting no-cache: true but it does increase an action execution time.

    UPD.
    Started to fail again

  3. patbernard commented on Apr 1, 2025

    @patbernard

    is this indicating version 3.2.4 of actions/cache is being used and this indicates that it's deprecated?

    If you look at the latest release for v6, it's pointing to 4.0.2 - which should be fine: https://github.com/docker/build-push-action/blob/v6.15.0/yarn.lock

    Edit: @bradley-yoo-anrok good catch. The latest version of build-push-action is pinned to a deprecated version. I was under the impression that v4.* was okay from this notice: https://github.blog/changelog/2025-01-15-github-actions-ubuntu-20-runner-image-brownout-dates-and-other-breaking-changes/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down

    But that scope is obviously larger than the original notice now.

  4. newman-dani commented on Apr 1, 2025

    @newman-dani

    @patbernard I do use 471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 and still getting it.

  5. bradley-yoo-anrok commented on Apr 1, 2025

    @bradley-yoo-anrok

    I don't think 4.0.2 is fine. if you look at the original deprecation notice, 4.1.2 is deprecated.

    I can't believe the github's own decomission notice contains examples of upgrades that doesn't work.

  6. andrewhharmon commented on Apr 1, 2025

    @andrewhharmon

    yes we tried v6 and still got it as well

  7. mmckane commented on Apr 1, 2025

    @mmckane

    I also tried V6 and am seeing this happen

  8. andrewhharmon commented on Apr 1, 2025

    @andrewhharmon

    I think this is the package being used here. it says v4.0.0 should be good.

  9. mmckane commented on Apr 1, 2025

    @mmckane

    if it helps I am using docker/setup-buildx-action@v3 as well

  10. trautonen commented on Apr 1, 2025

    @trautonen

    I'm using the latest docker/setup-buildx-action@v3 which yarn.lock currently points to

    "@actions/cache@npm:^4.0.2":
      version: 4.0.2
      resolution: "@actions/cache@npm:4.0.2"
    

    and the builds are failing

  11. jpugliesi commented on Apr 1, 2025

    @jpugliesi
  12. aarashy commented on Apr 1, 2025

    @aarashy

    Anybody know if its possible to use runs-on instead? We like this cache way better

  13. johnfountainsomos commented on Apr 1, 2025

    @johnfountainsomos

    Buildkit v0.20+ fixes this: moby/buildkit#5683

    You can upgrade by updating the docker/setup-buildx-action that's commonly run before this build-push-action:

    - uses: docker/setup-buildx-action@v3
      with:
        version: v0.20.0
    

    this did not work for us. still the same failure

  14. jpugliesi commented on Apr 1, 2025

    @jpugliesi

    Buildkit v0.20+ fixes this: moby/buildkit#5683
    You can upgrade by updating the docker/setup-buildx-action that's commonly run before this build-push-action:

    - uses: docker/setup-buildx-action@v3
      with:
        version: v0.20.0
    

    this did not work for us. still the same failure

    Indeed - v0.20 upgrades to cache API v2, while cache <v4.0 is being deprecated - updated my comment

  15. patbernard commented on Apr 1, 2025

    @patbernard

    It looks like what we need is docker/actions-toolkit to cut a new release (the latest release is using 4.0.2). See: docker/actions-toolkit#643

    Then docker/build-push-action can be updated to use the latest version of docker/actions-toolkit and we'll be on a supported version of actions/cache.

  16. andrewhharmon commented on Apr 1, 2025

    @andrewhharmon

    perhaps not as 4.0.0 and higher of the node library should support this .

  17. patbernard commented on Apr 1, 2025

    @patbernard

    I think that did the trick. I ran the changes on a fork, and it worked for me: https://github.com/patbernard/build-push-action/tree/patbernard/update-cache-action-version

    E.g.

        - name: Build and push image
          uses: patbernard/build-push-action@patbernard/update-cache-action-version
    
  18. bradley-yoo-anrok commented on Apr 1, 2025

    @bradley-yoo-anrok

    Are you sure it worked because the brownout just ended?

  19. patbernard commented on Apr 1, 2025

    @patbernard

    Are you sure it worked because the brownout just ended?

    I'm not sure now. 😢 I'll have to test again on April 8th if there's no other traction between now any then.

    I did test just the bump from 0.56 -> 0.57 and that still had the issue. So the only other test I did that was after the brown-out ended was using main instead of 0.57 of the actions-toolkit.


    Edit: Looking at this https://npmdiff.dev/%40actions%2Fcache/4.0.2/4.0.3/, I really doubt the 4.0.3 version fixes this. Feeling more confident it only worked because the brownout concluded.

  20. crazy-max commented on Apr 1, 2025

    @crazy-max
    Member

    Edit: Looking at this https://npmdiff.dev/%40actions%2Fcache/4.0.2/4.0.3/, I really doubt the 4.0.3 version fixes this. Feeling more confident it only worked because the brownout concluded.

    I don't think 4.0.2 is fine. if you look at the original deprecation notice, 4.1.2 is deprecated.

    actions/cache action should not be confused with the @actions/cache module. We are not using this library for type=gha cache backend but https://github.com/tonistiigi/go-actions-cache which supports the new cache service v2.

    ERROR: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset

    If you have this issue you're likely using BuildKit < 0.20.0 or Buildx < v0.21.0 that don't support cache service v2. This can happen on self-hosted runners so to make sure you're using the latest version of Buildx, either update your self-hosted runner or set version: latest in setup-buildx-action:

          -
            name: Set up Docker Buildx
            uses: docker/setup-buildx-action@v3
            with:
              version: latest

    Also it would be good if someone can give a link to the workflow run so we can take a look or full logs of the workflow.

  21. aleksey-perplexity commented on Apr 8, 2025

    @aleksey-perplexity

    I am using v0.20.2 of the buildkit, cached in our ECR:

        - name: Set up Docker Buildx # required for build cache
          id: buildx
          uses: docker/setup-buildx-action@v3
          with:
            driver-opts: image=[redacted].dkr.ecr.us-east-1.amazonaws.com/buildkit:v0.20.2
            install: true
    

    This last step in my workflow is failing:

        - name: Build locally
          uses: docker/build-push-action@v6
          ...
    

    Am I using the wrong version of something?

  22. crazy-max commented on Apr 8, 2025

    @crazy-max
    Member

    Am I using the wrong version of something?

    Check Buildx >= 0.21.0 as well: #1345 (comment)

  23. mbazalik commented on Apr 8, 2025

    @mbazalik

    I can confirm, having same issue using buildx v0.22.0, buildkit v0.20.2, build-push-action v6 :(

  24. mbazalik commented on Apr 8, 2025

    @mbazalik

    I stand corrected, was using buildx v0.20.0, trying now with v0.22.0

  25. mbazalik commented on Apr 8, 2025

    @mbazalik

    with buildx v0.22.0 it works

  26. vovimayhem commented on Apr 8, 2025

    @vovimayhem

    with buildx v0.22.0 it works

    Worked for me as well. @crazy-max Maybe setting the docker/setup-buildx-action to use this BuildX version by default should work?

  27. crazy-max commented on Apr 14, 2025

    @crazy-max
    Member

    Note about sunset of GHA cache service v1 added to our docs: https://docs.docker.com/build/ci/github-actions/cache/#github-cache

  28. locked as resolved and limited conversation to collaborators on Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions