Skip to content

Conversation

@jsternberg
Copy link
Collaborator

This changes the way the checksum is calculated for content that has
wildcards or include/exclude paths. The previous method would result in
a different checksum with the same file contents but different patterns
due to a different method of hashing the data.

This normalizes the way the data is hashed to use similar methods. The
wildcard path now strips the prefix from the path instead of using the
base path. It no longer adds an additional zero byte between entries but
instead uses the zero byte from the directory path key.

Fixes #6233.

…terns

This changes the way the checksum is calculated for content that has
wildcards or include/exclude paths. The previous method would result in
a different checksum with the same file contents but different patterns
due to a different method of hashing the data.

This normalizes the way the data is hashed to use similar methods. The
wildcard path now strips the prefix from the path instead of using the
base path. It no longer adds an additional zero byte between entries but
instead uses the zero byte from the directory path key.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
@tonistiigi tonistiigi requested a review from AkihiroSuda October 9, 2025 21:55
@AkihiroSuda AkihiroSuda merged commit 7cf577a into moby:master Oct 10, 2025
169 of 170 checks passed
@jsternberg jsternberg deleted the exclude-pattern-too-broad-cache-key branch October 11, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy with exclude pattern using too broad cache key

3 participants