Created
June 28, 2020 01:58
-
-
Save wzhliang/8b8e9fdf9b35c9146db814f7afcd8e48 to your computer and use it in GitHub Desktop.
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
FROM --platform=$BUILDPLATFORM debian:10 AS build | |
RUN apt-get update && \ | |
apt-get install -y curl gcc make | |
RUN curl -o /cross.sh https://raw.githubusercontent.com/tonistiigi/binfmt/18c3d40ae2e3485e4de5b453e8460d6872b24d6b/binfmt/scripts/cross.sh && chmod +x /cross.sh | |
RUN curl https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz | tar xz | |
WORKDIR hello-2.10 | |
ARG TARGETPLATFORM | |
RUN /cross.sh install gcc | sh | |
RUN LDFLAGS=-static \ | |
./configure --host $(/cross.sh cross-prefix) && \ | |
make && \ | |
mkdir -p /out && \ | |
mv hello /out | |
FROM scratch | |
COPY --from=build /out/hello /hello | |
ENTRYPOINT ["/hello"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment