Skip to content

feat(docker): expose UV_INDEX_URL and NPM_REGISTRY as optional build args#258

Merged
alvinkam2001 merged 4 commits into
mainfrom
akam/configurable-pkg-index-urls
Jun 2, 2026
Merged

feat(docker): expose UV_INDEX_URL and NPM_REGISTRY as optional build args#258
alvinkam2001 merged 4 commits into
mainfrom
akam/configurable-pkg-index-urls

Conversation

@alvinkam2001

@alvinkam2001 alvinkam2001 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Adds optional Docker build args so images can be built behind networks that block public PyPI / npm and instead mirror the registries via internal proxy (this is the case for Rocket).

Usage:

docker build \
  --build-arg UV_INDEX_URL=https://artifactory.example.com/api/pypi/pypi-remote/simple/ \
  -f agentex/Dockerfile .

docker build \
  --build-arg NPM_REGISTRY=https://artifactory.example.com/api/npm/npm-remote/ \
  -f agentex-ui/Dockerfile .

By default falls back to current behaviour if args are not specified

Greptile Summary

This PR adds optional UV_INDEX_URL and NPM_REGISTRY build args to the Python and UI Dockerfiles respectively, allowing builds behind corporate networks that proxy PyPI and npm through an internal Artifactory mirror. A DOCKER_REGISTRY prefix arg is also added so the base images themselves can be pulled from an internal registry. Default values preserve the existing public-registry behavior when the args are omitted.

  • agentex/Dockerfile: When UV_INDEX_URL is non-empty, each install step switches from uv sync to a uv export → uv pip install --index-url two-step; the ARG is correctly re-declared in every child stage (dev, docs-builder) that uses it, and the production stage is unaffected (it copies pre-built packages from base).
  • agentex-ui/Dockerfile: NPM_REGISTRY defaults to https://registry.npmjs.org/ so no empty-string edge case exists; the value is written to .npmrc only in the builder stage and is never copied into the production image.

Confidence Score: 5/5

Safe to merge — changes are purely additive build-time args with safe defaults that leave all existing build paths unchanged.

Both Dockerfiles correctly guard the new code paths: UV_INDEX_URL uses an explicit if [ -n ] check so an empty arg falls through to the unchanged uv sync path, and NPM_REGISTRY carries a non-empty default so no empty-string issue exists for npm. Registry URLs are never written to ENV and are not present in the final production images. ARGs are properly re-declared in each multi-stage FROM boundary. No correctness, security, or runtime concerns were found in the changed code.

No files require special attention.

Important Files Changed

Filename Overview
agentex/Dockerfile Adds optional UV_INDEX_URL build arg and DOCKER_REGISTRY support; uses a shell conditional to call uv export + uv pip install when the arg is non-empty, correctly avoiding both the empty-ENV and URL-baking problems raised in prior review threads. ARG is re-declared in each child stage (dev, docs-builder) as required.
agentex-ui/Dockerfile Adds optional NPM_REGISTRY and DOCKER_REGISTRY build args; NPM_REGISTRY defaults to the public registry so all existing builds are unaffected. Production stage does not copy .npmrc from builder, so the internal URL is not present in the final image.

Reviews (4): Last reviewed commit: "Merge branch 'main' into akam/configurab..." | Re-trigger Greptile

@alvinkam2001 alvinkam2001 requested a review from a team as a code owner June 1, 2026 16:19
Comment thread agentex/Dockerfile Outdated
Comment thread agentex/Dockerfile Outdated
@alvinkam2001 alvinkam2001 merged commit b6e6004 into main Jun 2, 2026
31 checks passed
@alvinkam2001 alvinkam2001 deleted the akam/configurable-pkg-index-urls branch June 2, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants