Skip to content

Commit

Permalink
pkg(docker-cli): split darwin static stage
Browse files Browse the repository at this point in the history
Avoids issue with dockercore/golang-cross:xx-sdk-extras that doesn't have
a dummy linux/arm/v5 platform

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Apr 8, 2023
1 parent d0429c1 commit 0439c7f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion pkg/docker-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 0439c7f

Please sign in to comment.