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/make/Dockerfile

38 lines
1.0 KiB
Docker
Raw Normal View History

2023-12-10 18:05:50 +00:00
ARG REGISTRY=local
FROM ${REGISTRY}/musl:latest as musl
2023-12-16 23:50:40 +00:00
FROM ${REGISTRY}/bootstrap:latest as bootstrap
2023-11-16 10:01:19 +00:00
2023-12-16 23:50:40 +00:00
FROM bootstrap as base
2023-11-16 10:01:19 +00:00
ENV SRC_SITE https://ftp.gnu.org/gnu/make
ENV SRC_VERSION 4.4
ENV SRC_HASH 581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18
2023-12-16 23:50:40 +00:00
FROM base as fetch
2023-11-16 10:01:19 +00:00
RUN wget ${SRC_SITE}/make-${SRC_VERSION}.tar.gz
RUN echo "${SRC_HASH} make-${SRC_VERSION}.tar.gz" | sha256sum -c
2023-12-16 23:50:40 +00:00
FROM fetch as build
2023-11-16 10:01:19 +00:00
RUN tar -xf make-${SRC_VERSION}.tar.gz
WORKDIR make-${SRC_VERSION}
RUN set -ex; \
./configure \
--build=x86_64-linux-musl \
--host=x86_64-linux-musl \
--target=x86_64-linux-musl \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-nls; \
2023-12-16 23:50:40 +00:00
make -j "$(nproc)"
FROM build as install
USER 0:0
RUN make DESTDIR="/rootfs" install
2023-11-19 07:38:16 +00:00
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
2023-12-16 23:50:40 +00:00
RUN find /rootfs -exec touch -hcd "@0" "{}" +
2023-11-16 10:01:19 +00:00
2023-12-12 17:45:39 +00:00
FROM scratch as package
2023-12-16 23:50:40 +00:00
COPY --from=install /rootfs /
2023-11-16 10:01:19 +00:00
ENTRYPOINT ["/usr/bin/make"]
CMD ["--version"]