Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/bootstrap-stage3 . /
ADD fetch/binutils-${VERSION}.tar.xz .
WORKDIR /binutils-${VERSION}
RUN --network=none <<-EOF
set -ex
CFLAGS='-Os -Wformat -Werror=format-security -O2' \
CXXFLAGS='-Os -Wformat -Werror=format-security -O2' \
./configure \
--build=$(uname -m)-linux-musl \
--host=$(uname -m)-linux-musl \
--target=$(uname -m)-linux-musl \
--with-build-sysroot= \
--with-sysroot=/ \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc \
--enable-plugins \
--without-zstd \
--disable-shared \
--disable-jansson \
--disable-gdb \
--disable-gprofng \
--disable-multilib \
--disable-nls \
--disable-werror \
--enable-gold \
--enable-64-bit-bfd \
--enable-default-execstack=no \
--enable-default-hash-style=gnu \
--enable-deterministic-archives \
--enable-ld=default \
--enable-new-dtags \
--enable-relro \
--enable-threads \
--with-mmap \
--with-pic
make -j "$(nproc)"
make DESTDIR="/rootfs" install
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /