Skip to content

dap: improve location resolution for duplicate digests - #3408

Merged
tonistiigi merged 1 commit into
docker:masterfrom
jsternberg:dap-better-location-resolution
Sep 10, 2025
Merged

tonistiigi merged 1 commit into
docker:masterfrom
jsternberg:dap-better-location-resolution

Conversation

@jsternberg

@jsternberg jsternberg commented Sep 4, 2025 •

Copy link
Copy Markdown
Collaborator

This improves location resolution for duplicate digests by making some
assumptions about the file structure to determine a "best match" when
there are multiple possible locations.

It uses the next operation (that this digest is the input for) to
determine a location. If the location of the current operation is before
the next operation, this location is preferred. If there are multiple
locations that happen before the next operation, the one closest to the
next operation (aka later in the file) is used instead.

This resolves the most common case of multiple identical FROM
statements without adding more code to the frontends themselves.

Related to #3404.

This improves location resolution for duplicate digests by making some
assumptions about the file structure to determine a "best match" when
there are multiple possible locations.

It uses the next operation (that this digest is the input for) to
determine a location. If the location of the current operation is before
the next operation, this location is preferred. If there are multiple
locations that happen before the next operation, the one closest to the
next operation (aka later in the file) is used instead.

This resolves the most common case of multiple identical `FROM`
statements without adding more code to the frontends themselves.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
@jsternberg
jsternberg force-pushed the dap-better-location-resolution branch from 4cd901f to bf40c24 Compare September 4, 2025 20:04
@tonistiigi
tonistiigi merged commit f4e02ad into docker:master Sep 10, 2025
138 checks passed
@jsternberg
jsternberg deleted the dap-better-location-resolution branch September 10, 2025 20:26
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