This repository has been archived on 2024-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
stagex/packages/gcc/Dockerfile

33 lines
856 B
Docker
Raw Normal View History

2023-11-17 10:00:25 +00:00
FROM imgrep/musl:latest as musl
FROM imgrep/bootstrap:latest as build
2023-11-08 22:39:09 +00:00
ENV GCC_SITE https://mirrors.kernel.org/gnu/gcc
2023-11-08 22:39:09 +00:00
ENV GCC_VERSION 13.2.0
ENV GCC_HASH e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da
2023-11-08 22:39:09 +00:00
RUN wget ${GCC_SITE}/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz
RUN echo "${GCC_HASH} gcc-${GCC_VERSION}.tar.xz" | sha256sum -c
RUN tar -xf gcc-${GCC_VERSION}.tar.xz
WORKDIR gcc-${GCC_VERSION}
2023-11-08 22:39:09 +00:00
RUN set -ex; \
./contrib/download_prerequisites; \
{ rm *.tar.* || true; }
RUN set -ex; \
./configure \
--build="x86_64-linux-musl" \
--host="x86_64-linux-musl" \
2023-11-08 22:39:09 +00:00
--disable-multilib \
--enable-languages=c,c++ \
--prefix /rootfs \
2023-11-08 22:39:09 +00:00
; \
make -j "$(nproc)"; \
make install-strip
COPY --from=musl /lib /libmusl
RUN mv /libmusl/* /rootfs/lib/
2023-11-08 22:39:09 +00:00
FROM scratch
COPY --from=build /rootfs /
2023-11-08 22:39:09 +00:00
ENTRYPOINT ["/bin/gcc"]
CMD ["--version"]