chore: Reduce AgentCore image size and harden Docker build - #421
Open
jeromevdl wants to merge 3 commits into
Open
chore: Reduce AgentCore image size and harden Docker build#421jeromevdl wants to merge 3 commits into
jeromevdl wants to merge 3 commits into
Conversation
- Security: fix versions + control sha256 of downloaded installers, upgrade to latest node 24 image 24.19) and enforce sha256, move git safe directory config into code to avoid * - performance: remove chown (30+ % of image size reduction)
jeromevdl
requested review from
JWThewes,
eipasteur,
leandrodamascena and
svozza
as code owners
August 27, 2026 08:08
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.
Summary
Reduces the AgentCore container image size and improves build reproducibility and security.
The primary issue was a recursive
chownover/opt, which duplicated the installed CLI and application files into a new Docker layer.Changes
chown -Rwith ownership-correct directory creation.Image-size results
ECR compressed image size:
Reduction 638.9 MB (34.2%)
The updated image uses approximately 61.4% of AgentCore’s 2 GB limit, leaving about 771.7 MB of headroom.
Validation