Skip to content

Conversation

@jackluo923
Copy link
Member

@jackluo923 jackluo923 commented Jan 8, 2026

Description

Add optional mirror configuration for building manylinux Docker containers in environments with restricted network access (e.g., behind firewalls).

New environment variables for build.sh:

  • QUAY_MIRROR - Alternative mirror for quay.io
  • ALMALINUX_MIRROR - Alternative mirror for AlmaLinux packages
  • USE_NETWORK_HOST - Set to true to enable --network=host for builds

Example usage:

QUAY_MIRROR=quay.m.daocloud.io \
ALMALINUX_MIRROR=mirrors.aliyun.com/almalinux \
USE_NETWORK_HOST=true \
./build.sh

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Built x86_64 manylinux container successfully with custom mirrors
  • Built aarch64 manylinux container successfully with custom mirrors (using QEMU emulation)
  • Verified default behavior (no env vars set) works unchanged

Summary by CodeRabbit

  • Chores
    • Docker image builds now support configurable package source mirrors for Quay and AlmaLinux
    • Added optional network host mode for build operations

✏️ Tip: You can customize this high-level summary in your review settings.


- Add ALMALINUX_MIRROR build arg for package mirrors
- Add QUAY_MIRROR build arg for base image registry
- Add USE_NETWORK_HOST option for --network=host mode
@jackluo923 jackluo923 requested a review from a team as a code owner January 8, 2026 07:34
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Walkthrough

Configuration changes add build-time arguments for customizable Docker image sources across manylinux architectures. QUAY_MIRROR specifies the base image registry, ALMALINUX_MIRROR optionally overrides AlmaLinux repository mirrors, and USE_NETWORK_HOST enables network isolation during container builds. Changes applied consistently to both aarch64 and x86_64 variants.

Changes

Cohort / File(s) Summary
Manylinux Dockerfiles (aarch64 & x86_64)
components/core/tools/docker-images/clp-env-base-manylinux_2_28-aarch64/Dockerfile, components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/Dockerfile
Added QUAY_MIRROR ARG (default: quay.io) for configurable base image source in FROM directive; added ALMALINUX_MIRROR ARG with conditional RUN step to override AlmaLinux repository baseurl when mirror is specified.
Build Scripts (aarch64 & x86_64)
components/core/tools/docker-images/clp-env-base-manylinux_2_28-aarch64/build.sh, components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/build.sh
Added --build-arg QUAY_MIRROR=quay.io and --build-arg ALMALINUX_MIRROR parameters to docker buildx command; added conditional --network=host flag when USE_NETWORK_HOST is true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: adding configurable mirror options for manylinux Docker build containers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jackluo923 jackluo923 requested a review from junhaoliao January 8, 2026 07:42
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Caution

Docstrings generation - FAILED

No docstrings were generated.

Copy link
Member

@junhaoliao junhaoliao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. shall we update the musllinux_1_2-x86_64 and musllinux_1_2-aarch64 Dockerfiles to use QUAY_MIRROR as well?
  2. for consistency, shall we update other build.sh to accept USE_NETWORK_HOST as well?
  3. Let's update docs/src/dev-docs/tooling-containers.md. consider a table that describes the variable name, default and description for each. we should be clear that both ALMALINUX_MIRROR and QUAY_MIRROR should be a hostname + path, not full URLs like https://xxx

ARG ALMALINUX_MIRROR
RUN if [ -n "${ALMALINUX_MIRROR}" ]; then \
sed -i -e 's|^mirrorlist=|#mirrorlist=|g' \
-e "s|^# baseurl=https://repo.almalinux.org|baseurl=https://${ALMALINUX_MIRROR}|g" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just in case the maintainers decide to use different amount of spaces? it might never happen though

Suggested change
-e "s|^# baseurl=https://repo.almalinux.org|baseurl=https://${ALMALINUX_MIRROR}|g" \
-e "s|^#[[:space:]]*baseurl=https://repo.almalinux.org|baseurl=https://${ALMALINUX_MIRROR}|g" \

ARG ALMALINUX_MIRROR
RUN if [ -n "${ALMALINUX_MIRROR}" ]; then \
sed -i -e 's|^mirrorlist=|#mirrorlist=|g' \
-e "s|^# baseurl=https://repo.almalinux.org|baseurl=https://${ALMALINUX_MIRROR}|g" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-e "s|^# baseurl=https://repo.almalinux.org|baseurl=https://${ALMALINUX_MIRROR}|g" \
-e "s|^#[[:space:]]*baseurl=https://repo.almalinux.org|baseurl=https://${ALMALINUX_MIRROR}|g" \

docker buildx build
--platform linux/arm64
--build-arg "ALMALINUX_MIRROR=${ALMALINUX_MIRROR:-}"
--build-arg "QUAY_MIRROR=${QUAY_MIRROR:-quay.io}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may not need this -quay.io fallback given we have specified so in the Dockerfile?

@junhaoliao
Copy link
Member

junhaoliao commented Jan 8, 2026

shall we update the musllinux_1_2-x86_64 and musllinux_1_2-aarch64 Dockerfiles to use QUAY_MIRROR as well?

if the needs are clearly scoped to manylinux only, i'm fine deferring this to another PR. (let's ask the rabbit to create a follow up issue

@junhaoliao
Copy link
Member

shall we update the musllinux_1_2-x86_64 and musllinux_1_2-aarch64 Dockerfiles to use QUAY_MIRROR as well?

if the needs are clearly scoped to manylinux only, i'm fine deferring this to another PR. (let's ask the rabbit to create a follow up issue

discussed offline - muslinux changes will be made in another PR

@junhaoliao junhaoliao modified the milestones: Backlog, February 2026 Jan 19, 2026
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