From cd7cf0f2b69c5c77621e2f7032424b7041778d31 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Thu, 6 Apr 2023 21:56:22 +0000 Subject: [PATCH] Cache kernel package dependencies --- kernel.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel.go b/kernel.go index 37d1187..a12bb0b 100644 --- a/kernel.go +++ b/kernel.go @@ -346,6 +346,11 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand, d += "RUN yum -y install grub2-tools-minimal " + "elfutils-libelf-devel\n" } + + // Cache kernel package dependencies + d += "export PKGNAME=$(yum search kernel-devel --showduplicates | grep '^kernel-devel' | cut -d ' ' -f 1 | head -n 1); " + + "yum -y install $PKGNAME $(echo $PKGNAME | sed 's/-devel//'); " + + "yum -y remove $PKGNAME $(echo $PKGNAME | sed 's/-devel//')\n" default: err = fmt.Errorf("%s not yet supported", sk.DistroType.String()) return