2024-02-09 07:30:28 +00:00
|
|
|
FROM scratch as base
|
|
|
|
ENV VERSION=2.15
|
2024-01-31 11:15:42 +00:00
|
|
|
ENV SRC_HASH=efa50ef983137eefc0a02fdb51509d624b5e3295c980aa127ceee4183455499e
|
2024-02-09 07:30:28 +00:00
|
|
|
ENV SRC_FILE=cpio-${VERSION}.tar.gz
|
|
|
|
ENV SRC_SITE=https://ftp.gnu.org/gnu/cpio/${SRC_FILE}
|
2024-01-31 11:15:42 +00:00
|
|
|
|
|
|
|
FROM base as fetch
|
2024-02-09 07:30:28 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
2024-01-31 11:15:42 +00:00
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/musl . /
|
2024-02-13 17:13:17 +00:00
|
|
|
RUN tar -xzf ${SRC_FILE}
|
|
|
|
WORKDIR cpio-${VERSION}
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
2024-01-31 11:15:42 +00:00
|
|
|
./configure \
|
|
|
|
--build=x86_64-unknown-linux-musl \
|
|
|
|
--host=x86_64-unknown-linux-musl \
|
|
|
|
--prefix=/usr \
|
2024-03-01 18:30:23 +00:00
|
|
|
--bindir=/usr/bin \
|
2024-01-31 11:15:42 +00:00
|
|
|
--mandir=/usr/share/man \
|
2024-02-15 12:57:43 +00:00
|
|
|
--infodir=/usr/share/info \
|
|
|
|
gl_cv_func_getcwd_path_max="no, but it is partly working"
|
2024-01-31 11:15:42 +00:00
|
|
|
make
|
2024-02-09 07:30:28 +00:00
|
|
|
EOF
|
2024-01-31 11:15:42 +00:00
|
|
|
|
|
|
|
FROM build as install
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN <<-EOF
|
|
|
|
set -eux
|
|
|
|
make DESTDIR=/rootfs install
|
|
|
|
EOF
|
2024-02-09 18:19:36 +00:00
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
2024-01-31 11:15:42 +00:00
|
|
|
|
2024-03-01 18:30:23 +00:00
|
|
|
FROM stagex/filesystem as package
|
|
|
|
COPY --from=install /rootfs/. /
|