Skip to content

imagetools: avoid excessive HTTP requests on create#3623

Merged
tonistiigi merged 2 commits intodocker:masterfrom
tonistiigi:imagetools-request-fixes
Jan 28, 2026
Merged

imagetools: avoid excessive HTTP requests on create#3623
tonistiigi merged 2 commits intodocker:masterfrom
tonistiigi:imagetools-request-fixes

Conversation

@tonistiigi
Copy link
Member

Two separate fixes to avoid bombarding registry with extra requests.

Potential follow-ups for the next feature release:

  • Limit the amount of parallelization. Too many requests are sent in parallel that is not optimal.
  • The attestation manifest is still accessed twice from the original repository if the same manifest that is in the index is also returned for the referrers command.

@tonistiigi tonistiigi added this to the v0.31.1 milestone Jan 22, 2026
@tonistiigi tonistiigi requested a review from jsternberg January 22, 2026 23:53
@tonistiigi
Copy link
Member Author

tonistiigi commented Jan 23, 2026

Added one more optimization for the case where multiple destination tags are set.

if err := eg2.Wait(); err != nil {
return err
}
ctx = withMediaTypeKeyPrefix(ctx) // because of containerd bug this needs to be called separately for each ctx/goroutine pair to avoid concurrent map write
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off-topic, but is there a ticket related to this so that we can track if it's still needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crazy-max
Copy link
Member

Needs rebase otherwise LGTM

Currently needed manifests were filtered out and then
copied in a loop, but for each copy still the full
unfiltered descriptor was copied instead of single
manifest, resulting multiple push attempts for same
descriptor.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
When creating resulting image index it is wasteful
to check for attestations for the descriptors in original
index what were already attestation for subject manifest.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi tonistiigi force-pushed the imagetools-request-fixes branch from 917d7f2 to 87c77ac Compare January 28, 2026 16:28
@tonistiigi tonistiigi merged commit 694bd9a into docker:master Jan 28, 2026
159 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants