Skip to content

Commit 4da0591

Browse files
authored
fix: use lockfile for reproducible builds and correct Dockerfile port comments (#365)
* fix: use lockfile for reproducible builds and correct port comments in 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) * fix: use two-step uv sync for reproducible Docker builds 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.
1 parent 5de204a commit 4da0591

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/assets/container/python/Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@ ENV UV_SYSTEM_PYTHON=1 \
88
PYTHONUNBUFFERED=1 \
99
DOCKER_CONTAINER=1
1010

11-
COPY pyproject.toml uv.lock* ./
12-
RUN uv pip install -r pyproject.toml
13-
1411
RUN useradd -m -u 1000 bedrock_agentcore
15-
USER bedrock_agentcore
12+
13+
COPY pyproject.toml uv.lock ./
14+
RUN uv sync --frozen --no-dev --no-install-project
1615

1716
COPY --chown=bedrock_agentcore:bedrock_agentcore . .
17+
RUN uv sync --frozen --no-dev
18+
19+
USER bedrock_agentcore
1820

19-
# 8080: AgentCore runtime endpoint
20-
# 8000: Local dev server (uvicorn)
21-
# 9000: OpenTelemetry collector
21+
# AgentCore Runtime service contract ports
22+
# https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-service-contract.html
23+
# 8080: HTTP Mode
24+
# 8000: MCP Mode
25+
# 9000: A2A Mode
2226
EXPOSE 8080 8000 9000
2327

2428
CMD ["opentelemetry-instrument", "python", "-m", "{{entrypoint}}"]

0 commit comments

Comments
 (0)