Skip to content

Commit

Permalink
add ld64 bake target
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
  • Loading branch information
tonistiigi committed Mar 2, 2021
1 parent 40e4822 commit 631ddc3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 8 additions & 5 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ RUN export INSTALLPREFIX=/opt/libtapi/ \
cd .. && rm -rf build
#xx-verify --static ./build/lib/libtapi.a

#FROM --platform=${BUILDPLATFORM} tonistiigi/xx:binutils-2.36.1-${TARGETOS}-${TARGETARCH}${TARGETVARIANT}-alpine AS binutils-release

FROM --platform=${BUILDPLATFORM} alpine AS cctools-base
RUN apk add --no-cache git clang lld make binutils
RUN apk add --no-cache git clang lld make llvm
COPY --from=base / /
WORKDIR /work
ARG CCTOOLS_REPO=https://github.com/tpoechtrager/cctools-port
ARG CCTOOLS_VERSION=949.0.1-ld64-530
RUN git clone https://github.com/tpoechtrager/cctools-port -b ${CCTOOLS_VERSION}
RUN git clone $CCTOOLS_REPO -b ${CCTOOLS_VERSION}
WORKDIR ./cctools-port/cctools
ARG TARGETPLATFORM
RUN xx-apk add --no-cache musl-dev gcc g++
Expand Down Expand Up @@ -189,9 +192,9 @@ COPY --from=sigtool-base /work/sigtool/build/gensig /sigtool-gensig
FROM --platform=$BUILDPLATFORM tonistiigi/osxcross:11.1 AS darwinsdk

FROM scratch AS ld64-signed-static
COPY --from=ld64-static / /usr/bin
COPY --from=sigtool / /usr/bin
COPY ld64.signed /usr/bin
COPY --from=ld64-static / /
COPY --from=sigtool / /
COPY ld64.signed /

FROM --platform=$BUILDPLATFORM alpine AS ld64-tgz-build
WORKDIR /work
Expand Down
8 changes: 8 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ target "base-all" {
inherits = ["base", "_all-platforms"]
}

target "ld64-tgz" {
context = "base"
target = "ld64-tgz"
output = ["./ld64-tgz"]
platforms = ["linux/amd64", "linux/arm64", "linux/arm", "linux/arm/v6", "linux/386"]
cache-to = ["type=inline"]
}

variable "BINUTILS_VERSION_ONLY" {
default = ""
}
Expand Down

0 comments on commit 631ddc3

Please sign in to comment.