49 lines
1.3 KiB
Docker
49 lines
1.3 KiB
Docker
FROM scratch as base
|
|
ARG ARCH=x86_64
|
|
ENV VERSION=1.07.1
|
|
ENV SRC_HASH=62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a
|
|
ENV SRC_FILE=bc-${VERSION}.tar.gz
|
|
ENV SRC_SITE=https://ftp.gnu.org/gnu/bc/${SRC_FILE}
|
|
|
|
FROM base as fetch
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
FROM fetch as build
|
|
COPY --from=stagex/binutils . /
|
|
COPY --from=stagex/coreutils . /
|
|
COPY --from=stagex/musl . /
|
|
COPY --from=stagex/make . /
|
|
COPY --from=stagex/gcc . /
|
|
COPY --from=stagex/openssl . /
|
|
COPY --from=stagex/bash . /
|
|
COPY --from=stagex/bash /bin/bash /bin/sh
|
|
COPY --from=stagex/tar . /
|
|
COPY --from=stagex/ed . /
|
|
COPY --from=stagex/grep . /
|
|
COPY --from=stagex/gzip . /
|
|
COPY --from=stagex/bison . /
|
|
COPY --from=stagex/flex . /
|
|
COPY --from=stagex/gawk . /
|
|
COPY --from=stagex/perl . /
|
|
COPY --from=stagex/texinfo . /
|
|
COPY --from=stagex/findutils . /
|
|
COPY --from=stagex/sed . /
|
|
RUN tar -xf ${SRC_FILE}
|
|
WORKDIR bc-${VERSION}
|
|
RUN --network=none <<-EOF
|
|
set -ex
|
|
./configure \
|
|
--build=${ARCH}-linux-musl \
|
|
--host=${ARCH}-linux-musl \
|
|
--prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--mandir=/usr/share/man \
|
|
--infodir=/usr/share/info
|
|
make -j1
|
|
EOF
|
|
|
|
FROM build as install
|
|
RUN --network=none make DESTDIR="/rootfs" install
|
|
|
|
FROM stagex/filesystem as package
|
|
COPY --from=install /rootfs/. /
|