Investigate unexpected changes to Docker Asset Hashing #31961
Labels
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
In our integration tests & canaries, we are seeing that the same Docker image gets tagged with 1000 different asset hashes.
How it works
Asset hashes are (should be) based on the contents of the
Dockerfile
directly, whether all files in there are used or not. Example:The image digest (the unique identifier) is based on the actual built artifact, which depends on what's actually in the Dockerfile.
It can therefore happen that adding
four.txt
to the directory changes our calculated hash, but doesn't actually change the Docker image that gets built; that way, multiple images can end up with different asset hash tags.The problem
In the integ tests, we are seeing 100s or 1000 tags on a unique image (the
ecr.public/alpine:latest
image), even though nothing should have changed between runs. We seem to be adding ~10 tags/day.Something is affecting the hash that gets calculated on every canary run and integ test run, but we don't know what it is. Investigate that, and see if there's a problem in the construct lib that we need to fix.
The text was updated successfully, but these errors were encountered: