57 lines
1.5 KiB
Docker
57 lines
1.5 KiB
Docker
FROM gitea.okami101.io/okami101/stagex/core-binutils:latest AS binutils
|
|
FROM gitea.okami101.io/okami101/stagex/core-gcc:latest AS gcc
|
|
FROM gitea.okami101.io/okami101/stagex/core-make:latest AS make
|
|
FROM gitea.okami101.io/okami101/stagex/core-musl:latest AS musl
|
|
FROM gitea.okami101.io/okami101/stagex/core-busybox:latest AS busybox
|
|
|
|
FROM scratch AS bootstrap-c-toolchain
|
|
COPY --from=binutils / /
|
|
COPY --from=gcc / /
|
|
COPY --from=make / /
|
|
COPY --from=musl / /
|
|
COPY --from=busybox / /
|
|
|
|
FROM bootstrap-c-toolchain AS build-make
|
|
|
|
WORKDIR /source
|
|
|
|
RUN wget https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz -O make.tar.gz
|
|
|
|
RUN tar -xzf make.tar.gz --strip-components=1 && \
|
|
mkdir build && \
|
|
cd build && \
|
|
../configure --prefix=/usr --without-guile
|
|
|
|
RUN cd build && \
|
|
make -j$(nproc)
|
|
|
|
RUN cd build && \
|
|
make DESTDIR=/rootfs install
|
|
|
|
FROM bootstrap-c-toolchain AS build-binutils
|
|
|
|
WORKDIR /source
|
|
|
|
RUN wget https://ftp.gnu.org/gnu/binutils/binutils-2.44.tar.xz -O binutils.tar.gz
|
|
|
|
RUN tar -xJf binutils.tar.xz --strip-components=1 && \
|
|
./configure \
|
|
--build=${BUILD} \
|
|
--host=${HOST} \
|
|
--prefix=/usr \
|
|
--disable-nls \
|
|
--disable-gdb \
|
|
--disable-gprofng \
|
|
--disable-werror \
|
|
--enable-deterministic-archives \
|
|
--enable-targets=aarch64-linux-musl,aarch64_be-linux-musl,i686-linux-musl,x86_64-linux-musl,x86_64-linux-muslx32,x86_64-pep
|
|
|
|
RUN make -j $(nproc)
|
|
|
|
RUN make DESTDIR=/rootfs install && \
|
|
rm -r /rootfs/usr/share/man
|
|
|
|
FROM busybox AS final
|
|
COPY --from=build-make /rootfs/ /
|
|
COPY --from=build-binutils /rootfs/ /
|