From 3211c3348168239396da8a867e5896d8fafff64a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 24 Jan 2024 00:46:38 +0100 Subject: [PATCH] [0.11] Dockerfile: install musl-dev to fix build on alpine 3.18 and up Before this: docker build --build-arg ALPINE_VERSION=3.18 --build-arg GO_VERSION=1.20.13 --target integration-tests . > [dnsname 3/3] RUN --mount=target=/root/.cache,type=cache set -e; make binaries; mv bin/dnsname /usr/bin/dnsname: 0.435 GO111MODULE=on go build -mod=vendor -ldflags '-X main.gitCommit=18822f9a4fb35d1349eb256f4cd2bfd372474d84' -o bin/dnsname github.com/containers/dnsname/plugins/meta/dnsname 0.610 # runtime/cgo 0.610 In file included from _cgo_export.c:3: 0.610 /usr/include/fortify/stdlib.h:23:15: fatal error: stdlib.h: No such file or directory 0.610 23 | #include_next 0.610 | ^~~~~~~~~~ 0.610 compilation terminated. With this patch: docker build --build-arg ALPINE_VERSION=3.18 --build-arg GO_VERSION=1.20.13 --target integration-tests . ... => exporting to image 0.0s => => exporting layers 0.0s => => exporting manifest sha256:59323c8f3ae7d6510ad7d89304e1315d73d5171dbbaca1bb76fbabcd8c100d28 0.0s => => exporting config sha256:3c98c4ca486e2e0c4dd4d7625c70d10bd15d0df8e7385a99f7ccd83d5f65c93f 0.0s => => exporting attestation manifest sha256:9b213910467865818b0df74acc440eca65cf2ea7222795df78962970af53a1fb 0.0s => => exporting manifest list sha256:e26824a918764287b592f250fdfcc7dd7c60f70534075f96f4fd2f9499466f81 0.0s => => naming to moby-dangling@sha256:e26824a918764287b592f250fdfcc7dd7c60f70534075f96f4fd2f9499466f81 0.0s => => unpacking to moby-dangling@sha256:e26824a918764287b592f250fdfcc7dd7c60f70534075f96f4fd2f9499466f81 0.0s Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f31a6ba1adfe..2da23956802a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,7 @@ RUN apk add --no-cache git # gobuild is base stage for compiling go/cgo FROM golatest AS gobuild-base -RUN apk add --no-cache file bash clang lld pkgconfig git make +RUN apk add --no-cache file bash clang lld pkgconfig git make musl-dev COPY --link --from=xx / / # runc source