Repository navigation
Conversation
The base stage of every published Lambda runtime Dockerfile installs libicu via dnf without cleaning the package-manager cache. Because the final published image stage is FROM base, it inherits that cache layer, baking ~170 MB of dnf/yum repository metadata (solv/solvx solver caches and filelists.xml.gz) into the shipped image. Deleting the cache in a downstream layer cannot reclaim those bytes. Clean the cache in the same RUN instruction that installs libicu so the metadata never lands in the committed layer. Applied across all eight published Dockerfiles (net8, net9, net10, net11 x amd64, arm64). Fixes #2594
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available
Fixes #2594
Description of changes
The
basestage of every published Lambda runtime Dockerfile installslibicuviadnfwithout cleaning the package-manager cache:Because the final published image stage is
FROM base, it inherits that cache layer, baking roughly 170 MB of dnf/yum repository metadata into the shipped image (the.solv/.solvxsolver caches andfilelists.xml.gz). Deleting the cache in a downstream layer cannot reclaim those bytes — the whiteout only hides them while the earlier layer still carries them.This PR cleans the cache in the same
RUNinstruction that installslibicu, so the metadata never lands in the committed layer:RUN dnf install libicu-67.1-7.amzn2023.0.4.<arch> --assumeyes && \ dnf clean all && \ rm -rf /var/cache/dnf /var/cache/yumAlthough the issue was filed against
net10/arm64, the same uncleaned install exists in every published runtime Dockerfile, so the fix is applied across all eight:No runtime behavior changes — this only removes build-time package-manager cache that is dead weight at runtime, reducing image size and pull times for downstream consumers.
Checklist
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.