[AMD] fix(docker): unbreak nightly when archive.ubuntu.com:80 is unreachable (#24407)
This commit is contained in:
@@ -109,8 +109,31 @@ ARG MORI_COMMIT="v1.1.1"
|
||||
# AMD AINIC apt repo settings
|
||||
ARG AINIC_VERSION=1.117.5-a-38
|
||||
ARG UBUNTU_CODENAME=jammy
|
||||
|
||||
# Optional Ubuntu mirror override + apt hardening.
|
||||
# - UBUNTU_MIRROR is empty by default (no behaviour change for local builds).
|
||||
# When set (typically in CI), all http://*archive.ubuntu.com and
|
||||
# http://*security.ubuntu.com entries in /etc/apt/sources.list are rewritten
|
||||
# to point at the given base URL, e.g.
|
||||
# --build-arg UBUNTU_MIRROR=https://archive.ubuntu.com
|
||||
# --build-arg UBUNTU_MIRROR=https://tw.archive.ubuntu.com
|
||||
# --build-arg UBUNTU_MIRROR=http://internal-cache.example.com
|
||||
# This mirrors the pattern already used in docker/Dockerfile (NVIDIA) and
|
||||
# docker/npu.Dockerfile, and lets CI runners that cannot reach Canonical's
|
||||
# port-80 mirror IPs still complete `apt-get update`.
|
||||
# - The 80-net-hardening apt config adds retries + per-request timeout so that
|
||||
# transient mirror flakes don't immediately fail a build (apt's default is 0
|
||||
# retries).
|
||||
ARG UBUNTU_MIRROR=
|
||||
USER root
|
||||
|
||||
RUN if [ -n "$UBUNTU_MIRROR" ]; then \
|
||||
sed -i "s|http://[^[:space:]/]*archive.ubuntu.com|$UBUNTU_MIRROR|g" /etc/apt/sources.list && \
|
||||
sed -i "s|http://[^[:space:]/]*security.ubuntu.com|$UBUNTU_MIRROR|g" /etc/apt/sources.list; \
|
||||
fi && \
|
||||
printf 'Acquire::Retries "5";\nAcquire::http::Timeout "30";\nAcquire::https::Timeout "30";\n' \
|
||||
> /etc/apt/apt.conf.d/80-net-hardening
|
||||
|
||||
# Fix hipDeviceGetName returning empty string in ROCm 7.0 docker images.
|
||||
# The ROCm 7.0 base image is missing libdrm-amdgpu-common which provides the
|
||||
# amdgpu.ids device-ID-to-marketing-name mapping file.
|
||||
|
||||
Reference in New Issue
Block a user