This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from aryan9600/libgit2-only
- Loading branch information
Showing
8 changed files
with
438 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This Dockerfile tests the hack/Makefile output against git2go. | ||
ARG BASE_VARIANT=alpine | ||
ARG GO_VERSION=1.17 | ||
ARG XX_VERSION=1.1.0 | ||
|
||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx | ||
|
||
FROM --platform=$BUILDPLATFORM ${BASE_VARIANT} AS build-base | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
build-base \ | ||
linux-headers \ | ||
perl \ | ||
cmake \ | ||
pkgconfig \ | ||
gcc \ | ||
musl-dev \ | ||
clang \ | ||
lld | ||
|
||
COPY --from=xx / / | ||
|
||
FROM build-base AS build-cross | ||
|
||
ARG TARGETPLATFORM | ||
|
||
RUN xx-apk add --no-cache \ | ||
build-base \ | ||
pkgconfig \ | ||
gcc \ | ||
musl-dev \ | ||
clang \ | ||
lld \ | ||
llvm \ | ||
linux-headers | ||
|
||
WORKDIR /build | ||
COPY hack/static.sh . | ||
|
||
ENV CC=xx-clang | ||
ENV CXX=xx-clang++ | ||
|
||
RUN ./static.sh build_libgit2_only | ||
|
||
# trimmed removes all non necessary files (i.e. openssl binary). | ||
FROM build-cross AS trimmed | ||
|
||
ARG TARGETPLATFORM | ||
RUN mkdir -p /trimmed/usr/local/$(xx-info triple)/ && \ | ||
mkdir -p /trimmed/usr/local/$(xx-info triple)/share | ||
|
||
RUN cp -r /usr/local/$(xx-info triple)/lib/ /trimmed/usr/local/$(xx-info triple)/ && \ | ||
cp -r /usr/local/$(xx-info triple)/include/ /trimmed/usr/local/$(xx-info triple)/ | ||
|
||
FROM scratch as libs-arm64 | ||
COPY --from=trimmed /trimmed/ / | ||
|
||
FROM scratch as libs-amd64 | ||
COPY --from=trimmed /trimmed/ / | ||
|
||
FROM scratch as libs-armv7 | ||
COPY --from=trimmed /trimmed/ / | ||
|
||
FROM libs-$TARGETARCH$TARGETVARIANT as libs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.