Skip to content

Build job optimization based on build cache #633

Closed

Description

@mthalman

This is part of a set of phases outlined by #186.

This phase would optimize the build for cases where a particular build job would end up not producing any new images because all the images it would have been result in cache hits. To do this, the same logic that the build command uses to determine whether an image needs to be built would be executed as part of the build matrix generation. When that logic is run over the entire set of Dockerfiles, any build legs that do not have any Dockerfiles to be built can simply be trimmed from the matrix. This avoids executing build jobs that would end up not building any new images. This is only intended as an optimization for trimming out such jobs. The build command would still be responsible for calculating which images need to be built on its own.

Activity

  1. mthalman commented on Feb 23, 2021

    @mthalman
    MemberAuthor

    In order to implement this, we need to ensure that generating the build matrix is not done in parallel with mirroring the base images. This could lead to incorrect caching results where an image is mistakenly thought to be up-to-date when in fact the base image tag had not been mirrored yet. See dotnet/dotnet-docker#2617.

  2. moved this to On Deck in .NET Dockeron Dec 1, 2021
  3. moved this from On Deck to Backlog in .NET Dockeron Oct 12, 2022
  4. lbussell commented on Feb 2, 2026

    @lbussell
    Member

    @mthalman is this complete with #1449?

  5. moved this from Backlog to Done in .NET Dockeron Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions