feat(docker): expose UV_INDEX_URL and NPM_REGISTRY as optional build args#258
Open
alvinkam2001 wants to merge 2 commits into
Open
feat(docker): expose UV_INDEX_URL and NPM_REGISTRY as optional build args#258alvinkam2001 wants to merge 2 commits into
alvinkam2001 wants to merge 2 commits into
Conversation
smoreinis
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
By default falls back to current behaviour if args are not specified
Greptile Summary
This PR exposes optional
UV_INDEX_URL/UV_EXTRA_INDEX_URLandNPM_REGISTRYas Docker build args so images can be built behind networks that block public PyPI / npm registries. Both Dockerfiles fall back to standard public-registry behaviour when the args are omitted.agentex/Dockerfile: AddsARG-only declarations (noENV) for the two uv index vars and wraps eachuv synccall with a shell conditional (if [ -n "..." ]; then export ...) so uv never sees an empty-string env var. Args are correctly redeclared in every stage that needs them (base,dev,docs-builder); theproductionstage copies built artefacts frombaseand requires no changes.agentex-ui/Dockerfile: AddsARG NPM_REGISTRY=https://registry.npmjs.org/with a non-empty default and passes it directly tonpm config set registryinside the builder stage, keeping the URL out of the final production image's environment.Confidence Score: 5/5
Safe to merge — both Dockerfiles preserve existing default behaviour and the internal proxy URLs are not written into final image ENV layers.
The changes are additive-only build-time args with safe empty/default values. The uv conditional-export pattern prevents the empty-string env var pitfall previously flagged. Each downstream stage correctly redeclares the ARGs, and neither production image carries the proxy URL in its environment metadata.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["docker build --build-arg UV_INDEX_URL=... / NPM_REGISTRY=..."] subgraph agentex/Dockerfile B["base stage\nARG UV_INDEX_URL=\nARG UV_EXTRA_INDEX_URL="] C{"UV_INDEX_URL non-empty?"} D["export UV_INDEX_URL\nuv sync --frozen --no-dev"] E["uv sync --frozen --no-dev\n(default PyPI)"] F["dev stage\nredeclares ARGs\nuv sync --group dev"] G["docs-builder stage\nredeclares ARGs\nuv sync --group docs"] H["production stage\nCOPY --from=base\n(no uv sync needed)"] end subgraph agentex-ui/Dockerfile I["builder stage\nARG NPM_REGISTRY=https://registry.npmjs.org/"] J["npm config set registry NPM_REGISTRY\nnpm ci"] K["production stage\nCOPY built artifacts\n(no npm install)"] end A --> B B --> C C -->|yes| D C -->|no| E D --> F E --> F F --> G G --> H A --> I I --> J J --> KReviews (2): Last reviewed commit: "empty arg safety adjustments" | Re-trigger Greptile