Skip to content

Commit 20692cb

Browse files
committed
feat: support custom package index (UV_DEFAULT_INDEX) for Container builds
Enterprise customers using internal artifact repositories instead of public PyPI can now configure custom uv index URLs in ~/.agentcore/config.json. The CLI forwards these as Docker build args during container image builds (dev, package, deploy).
1 parent 73a18be commit 20692cb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/assets/container/python/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
22

3-
ARG UV_INDEX_URL
4-
ARG UV_EXTRA_INDEX_URL
3+
ARG UV_DEFAULT_INDEX
4+
ARG UV_INDEX
55

66
WORKDIR /app
77

@@ -10,8 +10,8 @@ ENV UV_SYSTEM_PYTHON=1 \
1010
UV_NO_PROGRESS=1 \
1111
PYTHONUNBUFFERED=1 \
1212
DOCKER_CONTAINER=1 \
13-
UV_INDEX_URL=${UV_INDEX_URL} \
14-
UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}
13+
UV_DEFAULT_INDEX=${UV_DEFAULT_INDEX} \
14+
UV_INDEX=${UV_INDEX}
1515

1616
RUN useradd -m -u 1000 bedrock_agentcore
1717

src/lib/packaging/build-args.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { readCliConfig } from '../utils/cli-config';
77
export function getUvBuildArgs(): string[] {
88
const config = readCliConfig();
99
const args: string[] = [];
10-
if (config.uvIndexUrl) args.push('--build-arg', `UV_INDEX_URL=${config.uvIndexUrl}`);
11-
if (config.uvExtraIndexUrl) args.push('--build-arg', `UV_EXTRA_INDEX_URL=${config.uvExtraIndexUrl}`);
10+
if (config.uvDefaultIndex) args.push('--build-arg', `UV_DEFAULT_INDEX=${config.uvDefaultIndex}`);
11+
if (config.uvIndex) args.push('--build-arg', `UV_INDEX=${config.uvIndex}`);
1212
return args;
1313
}

src/lib/utils/cli-config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { join } from 'path';
55
const CONFIG_FILE = join(homedir(), '.agentcore', 'config.json');
66

77
export interface CliConfig {
8-
uvIndexUrl?: string;
9-
uvExtraIndexUrl?: string;
8+
uvDefaultIndex?: string;
9+
uvIndex?: string;
1010
}
1111

1212
/**
@@ -18,8 +18,8 @@ export function readCliConfig(): CliConfig {
1818
const data = readFileSync(CONFIG_FILE, 'utf-8');
1919
const parsed: Record<string, unknown> = JSON.parse(data) as Record<string, unknown>;
2020
const config: CliConfig = {};
21-
if (typeof parsed.uvIndexUrl === 'string') config.uvIndexUrl = parsed.uvIndexUrl;
22-
if (typeof parsed.uvExtraIndexUrl === 'string') config.uvExtraIndexUrl = parsed.uvExtraIndexUrl;
21+
if (typeof parsed.uvDefaultIndex === 'string') config.uvDefaultIndex = parsed.uvDefaultIndex;
22+
if (typeof parsed.uvIndex === 'string') config.uvIndex = parsed.uvIndex;
2323
return config;
2424
} catch {
2525
return {};

0 commit comments

Comments
 (0)