From f097af79ca0445c72c6d70fdf8bdd524c41121e1 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 1 Feb 2022 13:54:24 +0100 Subject: [PATCH] Update centos8 mirrors Signed-off-by: Evan Lezar --- build/container/Dockerfile.centos | 9 +++++++++ docker/Dockerfile.centos | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/build/container/Dockerfile.centos b/build/container/Dockerfile.centos index c6a5b46b..1b580b00 100644 --- a/build/container/Dockerfile.centos +++ b/build/container/Dockerfile.centos @@ -42,6 +42,15 @@ RUN GOPATH=/artifacts go install -ldflags="-s -w -X 'main.Version=${VERSION}'" . FROM nvidia/cuda:${CUDA_VERSION}-base-${BASE_DIST} +ARG BASE_DIST +# See https://www.centos.org/centos-linux-eol/ +# and https://stackoverflow.com/a/70930049 +RUN [[ "${BASE_DIST}" != "centos8" ]] || \ + ( \ + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* \ + ) + ENV NVIDIA_DISABLE_REQUIRE="true" ENV NVIDIA_VISIBLE_DEVICES=all ENV NVIDIA_DRIVER_CAPABILITIES=utility diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos index c5c70f3d..71cdb761 100644 --- a/docker/Dockerfile.centos +++ b/docker/Dockerfile.centos @@ -1,6 +1,14 @@ ARG BASEIMAGE FROM ${BASEIMAGE} +ARG BASEIMAGE +# See https://www.centos.org/centos-linux-eol/ +# and https://stackoverflow.com/a/70930049 +RUN [[ "${BASEIMAGE}" != "centos:8" ]] || \ + ( \ + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-* \ + ) RUN yum install -y \ ca-certificates \ wget \