35 lines
948 B
Docker
35 lines
948 B
Docker
FROM scratch as base
|
|
ENV VERSION=1.2.3
|
|
ENV SRC_HASH=9ffb3479b15df0170eba4480e51723c3961dbe0b461ec289744622db03a69395
|
|
ENV SRC_FILE=v${VERSION}.tar.gz
|
|
ENV SRC_SITE=https://github.com/void-linux/musl-obstack/archive/refs/tags/${SRC_FILE}
|
|
|
|
FROM base as fetch
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
FROM fetch as build
|
|
COPY --from=stagex/busybox . /
|
|
COPY --from=stagex/gcc . /
|
|
COPY --from=stagex/binutils . /
|
|
COPY --from=stagex/make . /
|
|
COPY --from=stagex/musl . /
|
|
COPY --from=stagex/perl . /
|
|
COPY --from=stagex/autoconf . /
|
|
COPY --from=stagex/automake . /
|
|
COPY --from=stagex/libtool . /
|
|
COPY --from=stagex/pkgconf . /
|
|
COPY --from=stagex/m4 . /
|
|
RUN tar -xzf ${SRC_FILE}
|
|
WORKDIR musl-obstack-${VERSION}
|
|
RUN --network=none <<-EOF
|
|
set -eux
|
|
./bootstrap.sh
|
|
./configure --prefix=/usr
|
|
make -j "$(nproc)"
|
|
EOF
|
|
|
|
FROM build as install
|
|
RUN --network=none make DESTDIR=/rootfs install
|
|
|
|
FROM stagex/filesystem as package
|
|
COPY --from=install /rootfs/. /
|