Skip to content

Commit e1ce981

Browse files
committed
fix: address review — use pip install uv, fix import command, update docs
- Replace COPY --from with pip install uv==0.11.14 to fully eliminate third-party image pull at build time - Update agentcore import Dockerfile generation to use AWS ECR base image - Update docs/container-builds.md to reflect new base image setup Constraint: No AWS-hosted uv binary available; pip install is the cleanest path Confidence: high Scope-risk: narrow
1 parent 742c90b commit e1ce981

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

docs/container-builds.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ app/MyAgent/
3939

4040
## Generated Dockerfile
4141

42-
The template uses `ghcr.io/astral-sh/uv:python3.12-bookworm-slim` as the base image with these design choices:
42+
The template uses `public.ecr.aws/docker/library/python:3.12-slim` as the base image (with `uv` installed via
43+
`pip install uv==0.11.14`) with these design choices:
4344

4445
- **Layer caching**: Dependencies (`pyproject.toml`) are installed before copying application code
4546
- **Non-root**: Runs as `bedrock_agentcore` (UID 1000)

src/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`Dockerfile enableOtel rendering > renders opentelemetry-instrument CMD when enableOtel is true > Dockerfile-enableOtel-true 1`] = `
44
"FROM public.ecr.aws/docker/library/python:3.12-slim
55
6-
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
6+
RUN pip install --no-cache-dir uv==0.11.14
77
88
ARG UV_DEFAULT_INDEX
99
ARG UV_INDEX
@@ -43,7 +43,7 @@ CMD ["opentelemetry-instrument", "python", "-m", "main"]
4343
exports[`Dockerfile enableOtel rendering > renders plain python CMD when enableOtel is false > Dockerfile-enableOtel-false 1`] = `
4444
"FROM public.ecr.aws/docker/library/python:3.12-slim
4545
46-
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
46+
RUN pip install --no-cache-dir uv==0.11.14
4747
4848
ARG UV_DEFAULT_INDEX
4949
ARG UV_INDEX

src/assets/container/python/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM public.ecr.aws/docker/library/python:3.12-slim
22

3-
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
3+
RUN pip install --no-cache-dir uv==0.11.14
44

55
ARG UV_DEFAULT_INDEX
66
ARG UV_INDEX

src/cli/commands/import/actions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ export async function handleImport(options: ImportOptions): Promise<ImportResult
383383
fs.writeFileSync(
384384
destDockerfile,
385385
[
386-
'FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim',
386+
'FROM public.ecr.aws/docker/library/python:3.12-slim',
387+
'RUN pip install --no-cache-dir uv==0.11.14',
387388
'WORKDIR /app',
388389
'',
389390
'ENV UV_SYSTEM_PYTHON=1 \\',

0 commit comments

Comments
 (0)