Skip to content

feat: Refine CI docker cache#2761

Merged
dunglas merged 1 commit intoapi-platform:mainfrom
nervo:refine-ci-docker-cache
Sep 9, 2024
Merged

feat: Refine CI docker cache#2761
dunglas merged 1 commit intoapi-platform:mainfrom
nervo:refine-ci-docker-cache

Conversation

@nervo
Copy link
Copy Markdown
Contributor

@nervo nervo commented Sep 9, 2024

Refine CI docker cache handling, and obtain 100% cache hit during containers building.

While playing with docker bake action and github action based docker build layer cache, i've struggled a bit to discover that, in case of a multi target baking, every target must have its own scope (see: docker/bake-action#91 (comment)).

As this repo uses 2 targets, i've just used them as a prefix for each target cache scope:

$ docker buildx bake -f compose.yaml -f compose.override.yaml --print
...
{
  "group": {
    "default": {
      "targets": [
        "php",
        "pwa"
      ]
    }
  },
...

@dunglas
Copy link
Copy Markdown
Member

dunglas commented Sep 9, 2024

Awesome! Thanks for the research and for the fix!

@dunglas dunglas merged commit 707679b into api-platform:main Sep 9, 2024
@nervo nervo deleted the refine-ci-docker-cache branch September 9, 2024 19:52
back-2-95 pushed a commit to druidfi/api-platform that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants