From 6f413c6bb8902c77727f45e44c29dbf5b8ae2fa4 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 11:51:27 +0100 Subject: [PATCH 1/6] pkg(buildx): arm/v5 platform support Signed-off-by: CrazyMax --- pkg/buildx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/buildx/Makefile b/pkg/buildx/Makefile index d2592028..9ca509e2 100644 --- a/pkg/buildx/Makefile +++ b/pkg/buildx/Makefile @@ -26,7 +26,7 @@ export BUILDX_REF := $(if $(BUILDX_REF),$(BUILDX_REF),master) PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/buildx/blob/master/docker-bake.hcl#L110-L122 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 linux/s390x windows/amd64 windows/arm64 +PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 linux/s390x windows/amd64 windows/arm64 .PHONY: default default: pkg ; From c58700bdaaeb902bab858463abc491015214eff9 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 11:51:34 +0100 Subject: [PATCH 2/6] pkg(compose): arm/v5 platform support Signed-off-by: CrazyMax --- pkg/compose/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compose/Makefile b/pkg/compose/Makefile index c6cb682f..a29a153c 100644 --- a/pkg/compose/Makefile +++ b/pkg/compose/Makefile @@ -26,7 +26,7 @@ export COMPOSE_REF := $(if $(COMPOSE_REF),$(COMPOSE_REF),v2) PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/compose/blob/v2/docker-bake.hcl#L95-L107 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 linux/s390x windows/amd64 windows/arm64 +PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 linux/s390x windows/amd64 windows/arm64 .PHONY: default default: pkg ; From 44b074872681854d8e7ded7a7f133431b49c7b7a Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 11:51:40 +0100 Subject: [PATCH 3/6] pkg(containerd): arm/v5 platform support Signed-off-by: CrazyMax --- pkg/containerd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/containerd/Makefile b/pkg/containerd/Makefile index 166e2209..24d45d10 100644 --- a/pkg/containerd/Makefile +++ b/pkg/containerd/Makefile @@ -32,7 +32,7 @@ PKG_LIST ?= deb rpm static # FIXME: can't build static binaries with containerd Makefile for darwin/amd64 darwin/arm64 windows/amd64 platforms # FIXME: linux/riscv64 needs ubuntu:22.04 image # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= linux/amd64 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x +PKG_PLATFORMS ?= linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x .PHONY: default default: pkg ; From b2a7bb9ec98e95c6dae669ba51e7c704b1ef809c Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 11:51:55 +0100 Subject: [PATCH 4/6] pkg(credential-helpers): arm/v5 platform support Signed-off-by: CrazyMax --- pkg/credential-helpers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/credential-helpers/Makefile b/pkg/credential-helpers/Makefile index 8501756c..b343ec75 100644 --- a/pkg/credential-helpers/Makefile +++ b/pkg/credential-helpers/Makefile @@ -26,7 +26,7 @@ export CREDENTIAL_HELPERS_REF := $(if $(CREDENTIAL_HELPERS_REF),$(CREDENTIAL_HEL PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/docker-credential-helpers/blob/master/docker-bake.hcl#L56-L66 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x windows/amd64 +PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x windows/amd64 .PHONY: default default: pkg ; From 3aa426516175a448a9d9da7790c64da0ff099085 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 12:22:05 +0100 Subject: [PATCH 5/6] pkg(credential-helpers): split darwin static stage Avoids issue with dockercore/golang-cross:xx-sdk-extras that doesn't have a dummy linux/arm/v5 platform Signed-off-by: CrazyMax --- pkg/credential-helpers/Dockerfile | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pkg/credential-helpers/Dockerfile b/pkg/credential-helpers/Dockerfile index 890cc312..036dc598 100644 --- a/pkg/credential-helpers/Dockerfile +++ b/pkg/credential-helpers/Dockerfile @@ -153,7 +153,32 @@ RUN --mount=type=bind,source=scripts/pkg-rpm-build.sh,target=/usr/local/bin/pkg- OUTDIR=/out SRCDIR=/usr/local/src/docker-credential-helpers pkg-rpm-build # static -FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS builder-static +FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS builder-static-nosdk +COPY --from=xx / / +ARG DEBIAN_FRONTEND +RUN apt-get update && apt-get install -y --no-install-recommends bash ca-certificates file git zip tar \ + dpkg-dev clang make pkg-config +ENV GOPROXY="https://proxy.golang.org|direct" +ENV GOPATH="/go" +ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin" +ENV GO111MODULE="on" +ENV CGO_ENABLED="1" +ARG PKG_NAME +ARG CREDENTIAL_HELPERS_REF +ARG NIGHTLY_BUILD +WORKDIR /build +ARG TARGETPLATFORM +RUN xx-apt-get install -y gcc libsecret-1-dev +RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/pkg-static-build \ + --mount=type=bind,from=common-scripts,source=gen-ver.sh,target=/usr/local/bin/gen-ver \ + --mount=type=bind,from=common-scripts,source=fix-cc.sh,target=/usr/local/bin/fix-cc \ + --mount=type=bind,from=src,source=/src,target=/usr/local/src/credential-helpers \ + --mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw \ + OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/credential-helpers pkg-static-build +FROM builder-static-nosdk AS builder-static-linux +FROM builder-static-nosdk AS builder-static-windows + +FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS builder-static-darwin COPY --from=xx / / ARG DEBIAN_FRONTEND RUN apt-get update && apt-get install -y --no-install-recommends bash ca-certificates file git zip tar \ @@ -177,6 +202,8 @@ RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/p --mount=from=osxsdk,target=/xx-sdk,src=/xx-sdk \ OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/credential-helpers pkg-static-build +FROM builder-static-$TARGETOS AS builder-static + FROM builder-${PKG_TYPE} AS build-pkg ARG BUILDKIT_SBOM_SCAN_STAGE=true From 703c3f5d3007a8824ea521eca8c52dcec31046b1 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 8 Apr 2023 23:23:02 +0200 Subject: [PATCH 6/6] pkg(compose): split darwin static stage Avoids issue with dockercore/golang-cross:xx-sdk-extras that doesn't have a dummy linux/arm/v5 platform Signed-off-by: CrazyMax --- pkg/compose/Dockerfile | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pkg/compose/Dockerfile b/pkg/compose/Dockerfile index aa284c83..eb390824 100644 --- a/pkg/compose/Dockerfile +++ b/pkg/compose/Dockerfile @@ -157,7 +157,32 @@ RUN --mount=type=bind,source=scripts/pkg-rpm-build.sh,target=/usr/local/bin/pkg- OUTDIR=/out SRCDIR=/usr/local/src/compose pkg-rpm-build # static -FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS builder-static +FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS builder-static-nosdk +COPY --from=xx / / +ARG DEBIAN_FRONTEND +RUN apt-get update && apt-get install -y --no-install-recommends bash ca-certificates file git zip tar \ + dpkg-dev clang lld llvm make pkg-config +ENV GOPROXY="https://proxy.golang.org|direct" +ENV GOPATH="/go" +ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin" +ENV GO111MODULE="on" +ENV CGO_ENABLED="0" +ARG PKG_NAME +ARG COMPOSE_REF +ARG NIGHTLY_BUILD +WORKDIR /build +ARG TARGETPLATFORM +RUN xx-apt-get install -y gcc libc6-dev +RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/pkg-static-build \ + --mount=type=bind,from=common-scripts,source=gen-ver.sh,target=/usr/local/bin/gen-ver \ + --mount=type=bind,from=common-scripts,source=fix-cc.sh,target=/usr/local/bin/fix-cc \ + --mount=type=bind,from=src,source=/src,target=/usr/local/src/compose \ + --mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw \ + OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/compose pkg-static-build +FROM builder-static-nosdk AS builder-static-linux +FROM builder-static-nosdk AS builder-static-windows + +FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS builder-static-darwin COPY --from=xx / / ARG DEBIAN_FRONTEND RUN apt-get update && apt-get install -y --no-install-recommends bash ca-certificates file git zip tar \ @@ -181,6 +206,8 @@ RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/p --mount=from=osxsdk,target=/xx-sdk,src=/xx-sdk \ OUTDIR=/out BUILDDIR=/build SRCDIR=/usr/local/src/compose pkg-static-build +FROM builder-static-$TARGETOS AS builder-static + FROM builder-${PKG_TYPE} AS build-pkg ARG BUILDKIT_SBOM_SCAN_STAGE=true