From e1ffda19d29a65b3a77887c66b571e985a6c5a11 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Sun, 7 Oct 2018 14:18:18 +0000 Subject: [PATCH] Simplify CentOS docker files --- tools/kernel-factory/CentOS/6/Dockerfile | 24 ++++++------------------ tools/kernel-factory/CentOS/7/Dockerfile | 24 ++++++------------------ 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/tools/kernel-factory/CentOS/6/Dockerfile b/tools/kernel-factory/CentOS/6/Dockerfile index f15a72e..e43aa04 100644 --- a/tools/kernel-factory/CentOS/6/Dockerfile +++ b/tools/kernel-factory/CentOS/6/Dockerfile @@ -2,25 +2,13 @@ FROM centos:6 RUN yum -y groupinstall "Development Tools" -# Last release must be download from mirror.centos.org, because vault.centos.org -# does not containt repodata for last release. -RUN yum list --showduplicates kernel \ - | grep kernel | awk '{print $2}' | while read VERSION; do \ - echo kernel-devel-${VERSION} kernel-${VERSION}; \ - done | xargs yum install -y; - -# mirror.centos.org does not contain old releases. -RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/* -RUN sed -i 's;^#baseurl=http://mirror.centos.org/centos/;baseurl=http://vault.centos.org/;' /etc/yum.repos.d/* +# enable rpms from old minor releases +RUN sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-Vault.repo # do not remove old kernels RUN sed -i 's;installonly_limit=;installonly_limit=100500;' /etc/yum.conf -# After new release must put PREVIOUS version here, e.g. at the time of -# writing the comment last CentOS version was 6.10. -RUN for RELEASEVER in 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9; do \ - yum list --releasever=${RELEASEVER} --showduplicates kernel \ - | grep kernel | awk '{print $2}' | while read VERSION; do \ - echo kernel-devel-${VERSION} kernel-${VERSION}; \ - done | xargs yum install --releasever=${RELEASEVER} -y; \ - done +RUN yum list --showduplicates kernel | grep kernel | awk '{print $2}' \ + | while read VERSION; do \ + echo kernel-devel-${VERSION} kernel-${VERSION}; \ + done | xargs yum -y install diff --git a/tools/kernel-factory/CentOS/7/Dockerfile b/tools/kernel-factory/CentOS/7/Dockerfile index 512d7ea..a0d54d7 100644 --- a/tools/kernel-factory/CentOS/7/Dockerfile +++ b/tools/kernel-factory/CentOS/7/Dockerfile @@ -2,25 +2,13 @@ FROM centos:7 RUN yum -y groupinstall "Development Tools" -# Last release must be download from mirror.centos.org, because vault.centos.org -# does not containt repodata for last release. -RUN yum list --showduplicates kernel \ - | grep kernel | awk '{print $2}' | while read VERSION; do \ - echo kernel-devel-${VERSION} kernel-${VERSION}; \ - done | xargs yum install -y; - -# mirror.centos.org does not contain old releases. -RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/* -RUN sed -i 's;^#baseurl=http://mirror;baseurl=http://vault;' /etc/yum.repos.d/* +# enable rpms from old minor releases +RUN sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-Vault.repo # do not remove old kernels RUN sed -i 's;installonly_limit=;installonly_limit=100500;' /etc/yum.conf -# After new release must put PREVIOUS version here, e.g. at the time of -# writing the comment last CentOS version was 7.5.1804. -RUN for RELEASEVER in 7.0.1406 7.1.1503 7.2.1511 7.3.1611 7.4.1708; do \ - yum list --releasever=${RELEASEVER} --showduplicates kernel \ - | grep kernel | awk '{print $2}' | while read VERSION; do \ - echo kernel-devel-${VERSION} kernel-${VERSION}; \ - done | xargs yum install --releasever=${RELEASEVER} -y; \ - done +RUN yum list --showduplicates kernel | grep kernel | awk '{print $2}' \ + | while read VERSION; do \ + echo kernel-devel-${VERSION} kernel-${VERSION}; \ + done | xargs yum -y install