From 62e88947819b21fa44c0554ef437a780f60fcff8 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 00:22:19 +0100 Subject: [PATCH 1/3] pkg(docker-cli): add arm/v5 platform Signed-off-by: CrazyMax --- pkg/docker-cli/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/docker-cli/Makefile b/pkg/docker-cli/Makefile index 57f22881..fba76fcc 100644 --- a/pkg/docker-cli/Makefile +++ b/pkg/docker-cli/Makefile @@ -29,7 +29,7 @@ export PKG_RPM_RELEASE = 3 PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/cli/blob/master/docker-bake.hcl#L30-L42 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/386 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/386 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 d0429c1d602f3fc41f30d91139815077b90d95e6 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 00:22:35 +0100 Subject: [PATCH 2/3] pkg(docker-engine): add arm/v5 platform Signed-off-by: CrazyMax --- pkg/docker-engine/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/docker-engine/Makefile b/pkg/docker-engine/Makefile index a992a5cb..130795ec 100644 --- a/pkg/docker-engine/Makefile +++ b/pkg/docker-engine/Makefile @@ -29,7 +29,7 @@ export PKG_RPM_RELEASE = 3 PKG_LIST ?= deb rpm static # supported platforms: https://github.com/moby/moby/blob/master/docker-bake.hcl#L93-L101 # 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 windows/amd64 +PKG_PLATFORMS ?= linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x windows/amd64 .PHONY: default default: pkg ; From 0439c7f418d7adfbd8aeabb36636ee13c255934d Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sat, 21 Jan 2023 01:23:14 +0100 Subject: [PATCH 3/3] pkg(docker-cli): 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/docker-cli/Dockerfile | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pkg/docker-cli/Dockerfile b/pkg/docker-cli/Dockerfile index 49a6b1b8..bcdd1f21 100644 --- a/pkg/docker-cli/Dockerfile +++ b/pkg/docker-cli/Dockerfile @@ -184,7 +184,27 @@ ARG GOVERSIONINFO_VERSION RUN --mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw \ GOBIN=/out GO111MODULE=on go install "github.com/josephspurrier/goversioninfo/cmd/goversioninfo@${GOVERSIONINFO_VERSION}" -FROM build-base-static AS builder-static +FROM build-base-static AS builder-static-nosdk +ARG DEBIAN_FRONTEND +RUN apt-get install -y --no-install-recommends dpkg-dev clang lld llvm make pkg-config +ARG PKG_NAME +ARG DOCKER_CLI_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=/go/src/github.com/docker/cli,rw \ + --mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw \ + --mount=type=bind,from=goversioninfo,source=/out/goversioninfo,target=/usr/bin/goversioninfo \ + --mount=type=tmpfs,target=/go/src/github.com/docker/cli/winresources \ + OUTDIR=/out BUILDDIR=/build SRCDIR=/go/src/github.com/docker/cli pkg-static-build +FROM builder-static-nosdk AS builder-static-linux +FROM builder-static-nosdk AS builder-static-windows + +FROM build-base-static AS builder-static-darwin ARG DEBIAN_FRONTEND RUN apt-get install -y --no-install-recommends dpkg-dev clang lld llvm make pkg-config ARG PKG_NAME @@ -203,6 +223,8 @@ RUN --mount=type=bind,source=scripts/pkg-static-build.sh,target=/usr/local/bin/p --mount=type=tmpfs,target=/go/src/github.com/docker/cli/winresources \ OUTDIR=/out BUILDDIR=/build SRCDIR=/go/src/github.com/docker/cli pkg-static-build +FROM builder-static-$TARGETOS AS builder-static + FROM builder-${PKG_TYPE} AS build-pkg ARG BUILDKIT_SBOM_SCAN_STAGE=true