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 \