From be3f519573906cac39d45c42471a6ff24c9b074c Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Thu, 6 Apr 2023 21:08:51 +0000 Subject: [PATCH] Fix package cache --- kernel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel.go b/kernel.go index 52b530e..956a835 100644 --- a/kernel.go +++ b/kernel.go @@ -306,7 +306,7 @@ func generateBaseDockerImage(registry string, commands []config.DockerCommand, d += "RUN apt-get install -y build-essential libelf-dev\n" d += "RUN apt-get install -y wget git\n" // Install a single kernel and headers to ensure all dependencies are cached - d += "RUN PKGNAME=$(apt-cache search --names-only '^linux-headers-[0-9\\.\\-]*-generic' | awk '{ print $1 }' | head -n 1) " + + 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" if sk.DistroRelease >= "14.04" { d += "RUN apt-get install -y libseccomp-dev\n"