Skip to content

feat: support custom package index (UV_DEFAULT_INDEX) for Container builds#453

Merged
tejaskash merged 2 commits intomainfrom
feat/uv-index-url-container-builds
Feb 25, 2026
Merged

feat: support custom package index (UV_DEFAULT_INDEX) for Container builds#453
tejaskash merged 2 commits intomainfrom
feat/uv-index-url-container-builds

Conversation

@jesseturner21
Copy link
Contributor

@jesseturner21 jesseturner21 commented Feb 25, 2026

Description

Enterprise customers that enforce internal artifact repositories (instead of public PyPI) cannot build Container agents because uv sync in the Dockerfile defaults to PyPI. This PR adds support for configuring custom uv package index URLs via ~/.agentcore/config.json, which the CLI forwards as Docker --build-arg flags during all container image builds.

Uses the current (non-deprecated) uv environment variables UV_DEFAULT_INDEX and UV_INDEX per uv docs.

Configuration: Users add their index URLs once to ~/.agentcore/config.json:

{
  "uvDefaultIndex": "https://my-enterprise-repo/simple",
  "uvIndex": "https://another-repo/simple"
}

How it works:

  • New readCliConfig() utility reads ~/.agentcore/config.json (silently returns empty object if missing/malformed)
  • New getUvBuildArgs() helper converts config into --build-arg UV_DEFAULT_INDEX=... flags
  • Dockerfile template declares ARG UV_DEFAULT_INDEX / ARG UV_INDEX and sets them as ENV so all uv commands respect them
  • Build args are forwarded in all three Docker build call sites: dev base image, dev layer, and package/deploy

When no config is present, build args are empty and uv falls back to PyPI — fully backward-compatible.

Related Issue

Closes #

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Manual testing:

  • Without config: agentcore dev builds and runs Container agent successfully using default PyPI
  • With config (uvDefaultIndex: "https://pypi.org/simple"): Full end-to-end build succeeds; docker inspect confirms UV_DEFAULT_INDEX=https://pypi.org/simple is set in the built image
  • With fake enterprise URL: Build correctly fails with DNS error for the custom index, confirming args are forwarded into the Docker build context
  • Malformed/missing config: Gracefully returns empty args, no errors

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

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).
@jesseturner21 jesseturner21 requested a review from a team February 25, 2026 21:47
@github-actions github-actions bot added the size/s PR size: S label Feb 25, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 44.15% 3000 / 6795
🔵 Statements 43.72% 3159 / 7224
🔵 Functions 45.96% 621 / 1351
🔵 Branches 48.74% 1960 / 4021
Generated in workflow #726 for commit 353afc1 by the Vitest Coverage Report Action

@github-actions github-actions bot added size/s PR size: S and removed size/s PR size: S labels Feb 25, 2026
@jesseturner21 jesseturner21 force-pushed the feat/uv-index-url-container-builds branch from 3fc1322 to 20692cb Compare February 25, 2026 22:26
@github-actions github-actions bot added size/s PR size: S and removed size/s PR size: S labels Feb 25, 2026
@jesseturner21 jesseturner21 changed the title feat: support custom package index (UV_INDEX_URL) for Container builds feat: support custom package index (UV_DEFAULT_INDEX) for Container builds Feb 25, 2026
tejaskash
tejaskash previously approved these changes Feb 25, 2026
…uilds

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).
@jesseturner21 jesseturner21 force-pushed the feat/uv-index-url-container-builds branch from 20692cb to 353afc1 Compare February 25, 2026 22:41
@github-actions github-actions bot added size/s PR size: S and removed size/s PR size: S labels Feb 25, 2026
@tejaskash tejaskash merged commit 478fde8 into main Feb 25, 2026
20 checks passed
@tejaskash tejaskash deleted the feat/uv-index-url-container-builds branch February 25, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants