fix: use lockfile for reproducible builds and correct Dockerfile port comments#365
Merged
fix: use lockfile for reproducible builds and correct Dockerfile port comments#365
Conversation
…n Dockerfile - Use `uv sync --frozen --no-dev` instead of `uv pip install -r pyproject.toml` so builds resolve dependencies from uv.lock deterministically (CONT-06) - Require uv.lock (drop glob wildcard) since frozen sync needs it - Fix port comments to match AgentCore Runtime service contract: 8080=HTTP, 8000=MCP, 9000=A2A (CONT-07)
Contributor
Coverage Report
|
The single `uv sync` before COPY failed because hatchling needs README.md (not yet copied). Split into two steps: 1. `uv sync --frozen --no-dev --no-install-project` — deps only 2. `uv sync --frozen --no-dev` — project install after full COPY Also move `USER bedrock_agentcore` after both syncs so the venv created by root remains writable for the project install step.
padmak30
approved these changes
Feb 20, 2026
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
Replace
uv pip install -r pyproject.tomlwith a two-stepuv sync --frozenapproach so container builds resolve dependencies deterministically fromuv.lock:uv sync --frozen --no-dev --no-install-project— installs only dependencies (cached layer)uv sync --frozen --no-dev— installs the project itself after full source COPYThe
uv.lockCOPY glob (uv.lock*) is also tightened to require the lockfile (uv.lock).Correct the
EXPOSEport comments to match the AgentCore Runtime service contract: 8080 = HTTP Mode, 8000 = MCP Mode, 9000 = A2A Mode. The previous comments incorrectly described 8000 as a local dev server and 9000 as OpenTelemetry.Dockerfile restructure: Moved
USER bedrock_agentcoreafter bothuv syncsteps so the root-owned.venvremains writable during project installation. Theuseraddis moved earlier so--chowninCOPYstill works. The runtime process still runs as the non-rootbedrock_agentcoreuser.Test plan
npm run buildsucceedsnpx vitest run --project unit— 1737 passed, 0 failed)finch build)podman build)bedrock_agentcoreuser