Skip to content

Commit

Permalink
Merge pull request #80 from crazy-max/next-armv5
Browse files Browse the repository at this point in the history
pkg(buildx,compose,containerd,cred-helpers): arm/v5 support
  • Loading branch information
crazy-max committed Apr 8, 2023
2 parents cf554af + 703c3f5 commit 1ed7f95
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/buildx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
29 changes: 28 additions & 1 deletion pkg/compose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkg/compose/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
2 changes: 1 addition & 1 deletion pkg/containerd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down
29 changes: 28 additions & 1 deletion pkg/credential-helpers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkg/credential-helpers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down

0 comments on commit 1ed7f95

Please sign in to comment.