From 32b692f752521e17b8cce41e123b15e6f4131963 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Fri, 7 Apr 2023 16:27:56 +0000 Subject: [PATCH] Cleanup after cache kernel package dependencies --- kernel.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel.go b/kernel.go index 5108023..9b8b4b6 100644 --- a/kernel.go +++ b/kernel.go @@ -307,7 +307,8 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand, d += "RUN apt-get install -y wget git\n" // Install a single kernel and headers to ensure all dependencies are cached d += "RUN export PKGNAME=$(apt-cache search --names-only '^linux-headers-[0-9\\.\\-]*-generic' | awk '{ print $1 }' | head -n 1); " + - "apt-get install -y $PKGNAME $(echo $PKGNAME | sed 's/headers/image/')\n" + "apt-get install -y $PKGNAME $(echo $PKGNAME | sed 's/headers/image/'); " + + "apt-get remove -y $PKGNAME $(echo $PKGNAME | sed 's/headers/image/')\n" if sk.DistroRelease >= "14.04" { d += "RUN apt-get install -y libseccomp-dev\n" }