Compare commits

...

7 Commits

56 changed files with 774 additions and 490 deletions

View File

@ -1,9 +1,8 @@
ARG REGISTRY=local
ARG VERSION=fc6eeb6bd75ea0d0025a79ea9fe45614bd60ba14
ARG SRC_SITE=https://codeload.github.com/lrvick/live-bootstrap/legacy.tar.gz
ARG SRC_HASH=0c268b19cf9f4eefdaf45dab64ac393ccf8ee43de58f0721624cab358044bf78
FROM debian@sha256:bac353db4cc04bc672b14029964e686cd7bad56fe34b51f432c1a1304b9928da as debian
FROM ${REGISTRY}/stage0 as stage0
FROM stagex/stage0 as stage0
FROM debian as fetch
ARG VERSION

View File

@ -1,7 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/stage1:latest as stage1
FROM stage1 as base
FROM stagex/stage1 as base
ENV ARCH=x86_64
ENV TARGET=${ARCH}-linux-musl
ENV SYSROOT_DIR ${HOME}/build-sysroot

View File

@ -1,7 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/stage2 as stage2
FROM stage2 as base
FROM stagex/stage2 as base
ENV ARCH=x86_64
ENV TARGET=${ARCH}-linux-musl
ENV BUILD=i386-unknown-linux-musl

0
src/compat.sh Normal file → Executable file
View File

View File

@ -0,0 +1,51 @@
ARG REGISTRY=local
FROM ${REGISTRY}/busybox as busybox
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/binutils as binutils
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/make as make
FROM ${REGISTRY}/autoconf as autoconf
FROM ${REGISTRY}/automake as automake
FROM ${REGISTRY}/m4 as m4
FROM busybox as base
ENV VERSION=1.5.0
ENV SRC_FILE=${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/argp-standalone/argp-standalone/archive/refs/tags/${SRC_FILE}
ENV SRC_HASH=c29eae929dfebd575c38174f2c8c315766092cec99a8f987569d0cad3c6d64f6
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=autoconf . /
COPY --from=automake . /
COPY --from=m4 . /
FROM base as fetch
RUN wget ${SRC_SITE}
RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN tar -xf ${SRC_FILE}
WORKDIR argp-standalone-${VERSION}
RUN ls -lah
RUN set -eux; \
autoreconf -vif; \
CFLAGS="-fPIC" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var; \
make
FROM build as install
USER 0:0
RUN set -eux; \
install -D -m644 argp.h /rootfs/usr/include/argp.h; \
install -D -m755 libargp.a /rootfs/usr/lib/libargp.a; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View File

@ -1,13 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/m4:latest as m4
FROM ${REGISTRY}/perl:latest as perl
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE https://ftp.gnu.org/gnu/autoconf
ENV SRC_VERSION 2.71
ENV SRC_HASH f14c83cfebcc9427f2c3cea7258bd90df972d92eb26752da4ddad81c87a0faa4
@ -21,12 +12,12 @@ RUN set -eux; \
FROM fetch as build
RUN tar -xf ${SRC_FILE}
WORKDIR autoconf-${SRC_VERSION}
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=m4 . /
COPY --from=perl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/m4 . /
COPY --from=stagex/perl . /
ENV M4=/usr/bin/m4
RUN set -eux; \
./configure \
@ -36,7 +27,7 @@ RUN set -eux; \
from build as install
USER 0:0
RUN make DESTDIR=/rootfs install
COPY --from=perl . /rootfs/
COPY --from=stagex/perl . /rootfs/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,14 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/perl:latest as perl
FROM ${REGISTRY}/autoconf:latest as autoconf
FROM ${REGISTRY}/m4:latest as m4
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://ftp.gnu.org/gnu/automake
ENV SRC_VERSION=1.16.5
ENV SRC_HASH=f01d58cd6d9d77fbdca9eb4bbd5ead1988228fdb73d6f7a201f5f8d6b118b469
@ -20,13 +10,13 @@ RUN tar -xf automake-${SRC_VERSION}.tar.xz
FROM fetch as build
WORKDIR automake-${SRC_VERSION}
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=perl . /
COPY --from=m4 . /
COPY --from=autoconf . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/perl . /
COPY --from=stagex/m4 . /
COPY --from=stagex/autoconf . /
RUN set -eux; \
./configure \
--prefix=/usr; \
@ -35,8 +25,8 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN make DESTDIR=/rootfs install
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=perl . /rootfs/
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/perl . /rootfs/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,11 +1,4 @@
ARG REGISTRY=local
from ${REGISTRY}/binutils as binutils
from ${REGISTRY}/gcc as gcc
from ${REGISTRY}/musl as musl
from ${REGISTRY}/make as make
from ${REGISTRY}/busybox as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://ftp.gnu.org/gnu/bash
ENV SRC_VERSION=5.2.21
ENV SRC_HASH=c8e31bdc59b69aaffc5b36509905ba3e5cbb12747091d27b4b977f078560d5b8
@ -19,10 +12,10 @@ RUN set -eux; \
FROM fetch as build
RUN tar -xzf ${SRC_FILE}
WORKDIR bash-${SRC_VERSION}
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
RUN set -eux; \
mkdir -p /home/user/rootfs/lib; \
./configure \
@ -41,7 +34,7 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN make DESTDIR=/rootfs install
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,8 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/stage3 as stage3
FROM ${REGISTRY}/musl as musl
FROM stage3 as base
FROM stagex/stage3 as base
ENV SRC_SITE https://ftp.gnu.org/gnu/binutils
ENV SRC_VERSION 2.35
ENV SRC_HASH 1b11659fb49e20e18db460d44485f09442c8c56d5df165de9461eb09c8302f85
@ -53,7 +49,7 @@ RUN set -ex; \
FROM build as install
USER 0:0
RUN make DESTDIR="/rootfs" install;
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -133,6 +133,7 @@ out/python.tgz: \
out/binutils.tgz \
out/busybox.tgz \
out/openssl.tgz \
out/zlib.tgz \
out/make.tgz \
out/musl.tgz
$(call build,core,python)
@ -159,7 +160,8 @@ out/cmake.tgz: \
out/py-setuptools.tgz: \
out/busybox.tgz \
out/python.tgz
out/python.tgz \
out/zlib.tgz
$(call build,core,py-setuptools)
out/zlib.tgz: \
@ -179,6 +181,7 @@ out/llvm13.tgz: \
out/cmake.tgz \
out/ninja.tgz \
out/busybox.tgz \
out/zlib.tgz \
out/musl.tgz
$(call build,core,llvm,13.0.1)
@ -191,6 +194,7 @@ out/llvm.tgz: \
out/cmake.tgz \
out/ninja.tgz \
out/busybox.tgz \
out/zlib.tgz \
out/musl.tgz
$(call build,core,llvm)
$(BUILDER) tag $(REGISTRY)/llvm $(REGISTRY)/llvm:16
@ -289,16 +293,7 @@ out/gettext.tgz: \
out/make.tgz
$(call build,core,gettext)
out/heirloom.tgz: \
out/busybox.tgz \
out/gcc.tgz \
out/binutils.tgz \
out/musl.tgz \
out/make.tgz
$(call build,core,heirloom)
out/flex.tgz: \
out/heirloom.tgz \
out/busybox.tgz \
out/gcc.tgz \
out/autoconf.tgz \
@ -309,3 +304,74 @@ out/flex.tgz: \
out/musl.tgz \
out/make.tgz
$(call build,core,flex)
out/argp-standalone.tgz: \
out/libtool.tgz \
out/automake.tgz \
out/autoconf.tgz \
out/make.tgz \
out/musl.tgz \
out/m4.tgz \
out/gcc.tgz
$(call build,core,argp-standalone)
out/musl-fts.tgz: \
out/libtool.tgz \
out/automake.tgz \
out/autoconf.tgz \
out/make.tgz \
out/musl.tgz \
out/m4.tgz \
out/pkgconf.tgz \
out/gcc.tgz
$(call build,core,musl-fts)
out/musl-obstack.tgz: \
out/libtool.tgz \
out/automake.tgz \
out/autoconf.tgz \
out/make.tgz \
out/musl.tgz \
out/m4.tgz \
out/pkgconf.tgz \
out/gcc.tgz
$(call build,core,musl-obstack)
out/meson.tgz: \
out/busybox.tgz \
out/cmake.tgz \
out/llvm.tgz \
out/python.tgz \
out/py-setuptools.tgz \
out/linux-headers.tgz \
out/zlib.tgz
$(call build,core,meson)
out/libzstd.tgz: \
out/busybox.tgz \
out/meson.tgz \
out/python.tgz \
out/zlib.tgz
$(call build,core,libzstd)
out/elfutils.tgz: \
out/busybox.tgz \
out/argp-standalone.tgz \
out/musl.tgz \
out/musl-fts.tgz \
out/musl-obstack.tgz \
out/binutils.tgz \
out/bison.tgz \
out/flex.tgz \
out/linux-headers.tgz \
out/libtool.tgz \
out/gettext.tgz \
out/libzstd.tgz \
out/pkgconf.tgz \
out/autoconf.tgz \
out/automake.tgz \
out/m4.tgz \
out/make.tgz \
out/gcc.tgz \
out/zlib.tgz
$(call build,core,elfutils)

View File

@ -1,7 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/stage3 as stage3
FROM stage3 as base
FROM stagex/stage3 as base
ENV SRC_SITE=https://busybox.net/downloads
ENV SRC_VERSION=1.36.1
ENV SRC_HASH=b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314

View File

@ -1,26 +1,14 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/curl:latest as curl
FROM ${REGISTRY}/ninja:latest as ninja
FROM ${REGISTRY}/openssl:latest as openssl
FROM ${REGISTRY}/linux-headers:latest as linux-headers
FROM ${REGISTRY}/openssl:latest as openssl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://cmake.org/files
ENV SRC_VERSION=3.27.8
ENV SRC_HASH=fece24563f697870fbb982ea8bf17482c9d5f855d8c9bf0b82463d76c9e8d0cc
COPY --from=binutils . /
COPY --from=ninja . /
COPY --from=musl . /
COPY --from=make . /
COPY --from=linux-headers . /
COPY --from=gcc . /
COPY --from=openssl . /
COPY --from=stagex/binutils . /
COPY --from=stagex/ninja . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/gcc . /
COPY --from=stagex/openssl . /
FROM base as fetch
RUN wget --no-check-certificate ${SRC_SITE}/v3.27/cmake-${SRC_VERSION}.tar.gz
@ -44,11 +32,11 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN DESTDIR=/rootfs bin/cmake -P cmake_install.cmake
COPY --from=musl /lib/* /rootfs/lib/
COPY --from=musl /usr/lib/* /rootfs/usr/lib/
COPY --from=gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=openssl /usr/lib/* /rootfs/usr/lib/
COPY --from=stagex/musl /lib/* /rootfs/lib/
COPY --from=stagex/musl /usr/lib/* /rootfs/usr/lib/
COPY --from=stagex/gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=stagex/gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=stagex/openssl /usr/lib/* /rootfs/usr/lib/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -0,0 +1,63 @@
FROM stagex/busybox as base
ENV VERSION=0.190
ENV SRC_FILE=elfutils-${VERSION}.tar.bz2
ENV SRC_SITE=https://sourceware.org/elfutils/ftp/${VERSION}/${SRC_FILE}
ENV SRC_HASH=8e00a3a9b5f04bc1dc273ae86281d2d26ed412020b391ffcc23198f10231d692
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/bison . /
COPY --from=stagex/libtool . /
COPY --from=stagex/zlib . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/flex . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/gettext . /
COPY --from=stagex/m4 . /
COPY --from=stagex/argp-standalone . /
COPY --from=stagex/musl . /
COPY --from=stagex/musl-fts . /
COPY --from=stagex/musl-obstack . /
COPY --from=stagex/linux-headers . /
FROM base as fetch
RUN wget --no-check-certificate ${SRC_SITE} -O ${SRC_FILE}
RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN set -eux; \
tar -xjf ${SRC_FILE}
WORKDIR elfutils-${VERSION}
ADD *.patch .
RUN set -eux; \
patch -p1 < musl-macros.patch; \
autoreconf -vif; \
CFLAGS="-D_GNU_SOURCE -Wno-error -Wno-null-dereference" \
./configure \
--build="x86_64-linux-musl" \
--host="x86_64-linux-musl" \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--program-prefix=eu- \
--enable-deterministic-archives \
--disable-nls \
--disable-progs \
--disable-libdebuginfod \
--disable-debuginfod \
--with-zstd; \
make
FROM build as install
USER 0:0
RUN set -eux; \
mkdir -p /rootfs; \
make DESTDIR=/rootfs install; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View File

@ -0,0 +1,78 @@
diff -ur elfutils-0.187.orig/lib/libeu.h elfutils-0.187/lib/libeu.h
--- elfutils-0.187.orig/lib/libeu.h 2022-06-16 18:48:12.916472948 +0200
+++ elfutils-0.187/lib/libeu.h 2022-06-16 18:48:54.219839323 +0200
@@ -31,6 +31,18 @@
#include <stddef.h>
#include <stdint.h>
+#include <unistd.h>
+#include <alloca.h>
+#include <string.h>
+
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif
extern void *xmalloc (size_t) __attribute__ ((__malloc__));
extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
diff -ur elfutils-0.187.orig/src/arlib.h elfutils-0.187/src/arlib.h
--- elfutils-0.187.orig/src/arlib.h 2022-06-16 18:48:12.919806284 +0200
+++ elfutils-0.187/src/arlib.h 2022-06-16 18:48:18.879811052 +0200
@@ -29,6 +29,16 @@
#include <stdint.h>
#include <sys/types.h>
+#if !defined(ACCESSPERMS)
+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
+#endif
+#if !defined(ALLPERMS)
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
+#endif
+#if !defined(DEFFILEMODE)
+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
+#endif
+
/* State of -D/-U flags. */
extern bool arlib_deterministic_output;
diff -ur elfutils-0.187.orig/src/elfcompress.c elfutils-0.187/src/elfcompress.c
--- elfutils-0.187.orig/src/elfcompress.c 2022-06-16 18:48:12.919806284 +0200
+++ elfutils-0.187/src/elfcompress.c 2022-06-16 18:48:18.879811052 +0200
@@ -37,6 +37,14 @@
#include "libeu.h"
#include "printversion.h"
+#if !defined(FNM_EXTMATCH)
+# define FNM_EXTMATCH 0
+#endif
+
+#if !defined(ALLPERMS)
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
+#endif
+
/* Name and version of program. */
ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
diff -ur elfutils-0.187.orig/src/strip.c elfutils-0.187/src/strip.c
--- elfutils-0.187.orig/src/strip.c 2022-06-16 18:48:12.919806284 +0200
+++ elfutils-0.187/src/strip.c 2022-06-16 18:48:18.879811052 +0200
@@ -46,6 +46,14 @@
#include <system.h>
#include <printversion.h>
+#if !defined(FNM_EXTMATCH)
+# define FNM_EXTMATCH 0
+#endif
+
+#if !defined(ACCESSPERMS)
+#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
typedef uint8_t GElf_Byte;
/* Name and version of program. */

View File

@ -1,9 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/stage3:latest as stage3
FROM stage3 as base
FROM stagex/stage3 as base
ENV VERSION 12.2.0
ENV SRC_FILE gcc-$VERSION.tar.xz
ENV SRC_SITE https://mirrors.kernel.org/gnu/gcc/gcc-${VERSION}
@ -68,13 +63,13 @@ USER 0:0
RUN set -eux; \
make DESTDIR=/rootfs install-strip; \
ln -s gcc /rootfs/usr/bin/cc
COPY --from=musl /lib/* /rootfs/lib/
COPY --from=stagex/musl /lib/* /rootfs/lib/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM busybox as test
COPY --from=install /rootfs /
COPY --from=binutils . /
COPY --from=musl . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
ADD test.c .
RUN set -eux; \
gcc test.c -static -o main; \

View File

@ -1,12 +1,4 @@
ARG REGISTRY=local
ARG BUSYBOX_VERSION=latest
FROM ${REGISTRY}/bash:latest as bash
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/busybox:${BUSYBOX_VERSION} as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV GOOS=linux
ENV CGO_ENABLED=0
ENV VERSION=1.21.4
@ -18,11 +10,10 @@ ENV SRC_HASH_BOOTSTRAP_2=e25c9ab72d811142b7f41ff6da5165fec2d1be5feec3ef2c66bc0bd
ENV VERSION_BOOTSTRAP_1=1.4-bootstrap-20171003
ENV SRC_SITE_BOOTSTRAP_1=https://dl.google.com/go
ENV SRC_HASH_BOOTSTRAP_1=f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52
COPY --from=gcc . /
COPY --from=gcc . /
COPY --from=bash . /
COPY --from=musl . /
COPY --from=binutils . /
COPY --from=stagex/gcc . /
COPY --from=stagex/bash . /
COPY --from=stagex/musl . /
COPY --from=stagex/binutils . /
FROM base as fetch
RUN set -eux; \

View File

@ -1,22 +1,12 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/m4:latest as m4
FROM ${REGISTRY}/bash:latest as bash
FROM ${REGISTRY}/sed:latest as sed
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://ftp.gnu.org/gnu/libtool
ENV SRC_VERSION=2.4.6
ENV SRC_HASH=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=m4 . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/m4 . /
FROM base as fetch
RUN wget ${SRC_SITE}/libtool-${SRC_VERSION}.tar.xz
@ -33,9 +23,9 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN make DESTDIR=/rootfs install
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=bash . /rootfs
COPY --from=sed . /rootfs
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/bash . /rootfs
COPY --from=stagex/sed . /rootfs
RUN ln -s /bin/bash /rootfs/bin/sh
RUN find /rootfs -exec touch -hcd "@0" "{}" +

View File

@ -1,24 +1,14 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/binutils as binutils
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/make as make
FROM ${REGISTRY}/autoconf as autoconf
FROM ${REGISTRY}/automake as automake
FROM ${REGISTRY}/libtool as libtool
FROM ${REGISTRY}/busybox as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://github.com/libunwind/libunwind/releases/download
ENV SRC_VERSION=1.7.2
ENV SRC_HASH=a18a6a24307443a8ace7a8acc2ce79fbbe6826cd0edf98d6326d0225d6a5d6e6
COPY --from=gcc . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=binutils . /
COPY --from=autoconf . /
COPY --from=automake . /
COPY --from=libtool . /
COPY --from=stagex/gcc . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/binutils . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/libtool . /
FROM base as fetch
RUN wget ${SRC_SITE}/v${SRC_VERSION}/libunwind-${SRC_VERSION}.tar.gz

View File

@ -0,0 +1,76 @@
FROM stagex/busybox as base
ENV VERSION=1.5.5
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/facebook/zstd/archive/${SRC_FILE}
ENV SRC_HASH=98e9c3d949d1b924e28e01eccb7deed865eefebf25c2f21c702e5cd5b63b85e1
COPY --from=stagex/python . /
COPY --from=stagex/gcc . /
COPY --from=stagex/musl . /
COPY --from=stagex/meson . /
COPY --from=stagex/ninja . /
COPY --from=stagex/binutils . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/zlib . /
FROM base as fetch
RUN set -eux; \
wget ${SRC_SITE}; \
echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN tar -xf ${SRC_FILE}
WORKDIR zstd-${VERSION}
RUN set -eux; \
meson env2mfile \
--native \
--system=linux \
--cpu-family=x86_64 \
--cpu=x86_64 \
--endian=little \
-o meson.cross; \
meson setup \
--prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--includedir=/usr/include \
--datadir=/usr/share \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localedir=/usr/share/locale \
--sysconfdir=/etc \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--buildtype=plain \
--auto-features=auto \
--wrap-mode=nodownload \
--default-library=both \
--cross-file=meson.cross \
-Dbacktrace=disabled \
-Db_lto=false \
-Db_staticpic=true \
-Db_pie=true \
-Dpython.bytecompile=0 \
-Dwerror=false \
-Db_ndebug=true \
-Dbin_tests=false \
-Dbin_contrib=false \
-Dbin_programs=true \
-Dbacktrace=disabled \
-Dmulti_thread=enabled \
-Dlz4=disabled \
-Dlzma=disabled \
-Dzlib=disabled \
build/meson \
output; \
meson compile -C output
FROM build as install
USER 0:0
RUN set -eux; \
DESTDIR=/rootfs meson install --no-rebuild -C output; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View File

@ -1,8 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/stage3:latest as stage3
FROM stage3 as base
FROM stagex/stage3 as base
WORKDIR ${HOME}
ENV SRC_SITE https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/
ENV SRC_VERSION 6.6

View File

@ -1,31 +1,20 @@
ARG REGISTRY=local
ARG VERSION=16.0.6
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/binutils as binutils
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/openssl as openssl
FROM ${REGISTRY}/python as python
FROM ${REGISTRY}/py-setuptools as py-setuptools
FROM ${REGISTRY}/cmake as cmake
FROM ${REGISTRY}/ninja as ninja
FROM ${REGISTRY}/busybox as busybox
FROM ${REGISTRY}/openssl as openssl
FROM busybox as base
FROM stagex/busybox as base
ARG VERSION
ENV VERSION=${VERSION}
ENV SRC_VERSION=${VERSION}
ENV SRC_SITE=https://github.com/llvm/llvm-project/releases/download
ENV SRC_HASH_13_0_1=326335a830f2e32d06d0a36393b5455d17dc73e0bd1211065227ee014f92cbf8
ENV SRC_HASH_16_0_6=ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
COPY --from=binutils . /
COPY --from=cmake . /
COPY --from=ninja . /
COPY --from=musl . /
COPY --from=gcc . /
COPY --from=python . /
COPY --from=py-setuptools . /
COPY --from=openssl . /
COPY --from=stagex/binutils . /
COPY --from=stagex/cmake . /
COPY --from=stagex/ninja . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/python . /
COPY --from=stagex/py-setuptools . /
COPY --from=stagex/zlib . /
COPY --from=stagex/openssl . /
FROM base as fetch
RUN wget --no-check-certificate ${SRC_SITE}/llvmorg-${SRC_VERSION}/llvm-project-${SRC_VERSION}.src.tar.xz
@ -79,9 +68,9 @@ USER 0:0
RUN set -eux; \
DESTDIR="/rootfs" cmake --install build; \
python3 llvm/utils/lit/setup.py install --root="/rootfs"
COPY --from=musl /lib/* /rootfs/lib/
COPY --from=gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=stagex/musl /lib/* /rootfs/lib/
COPY --from=stagex/gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=stagex/gcc /usr/lib64/* /rootfs/usr/lib/
RUN ln -s lit /rootfs/usr/bin/llvm-lit
RUN find /rootfs -exec touch -hcd "@0" "{}" +

View File

@ -1,18 +1,11 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
FROM stagex/busybox as base
ENV SRC_SITE=https://ftp.gnu.org/gnu/m4
ENV SRC_VERSION=1.4.18
ENV SRC_HASH=ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
FROM base as fetch
RUN wget ${SRC_SITE}/m4-${SRC_VERSION}.tar.gz
@ -29,7 +22,7 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN make DESTDIR=/rootfs install
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,8 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/stage3 as stage3
FROM ${REGISTRY}/musl as musl
FROM stage3 as base
FROM stagex/stage3 as base
ENV SRC_SITE https://ftp.gnu.org/gnu/make
ENV SRC_VERSION 4.4
ENV SRC_HASH 581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18
@ -28,7 +24,7 @@ RUN set -ex; \
FROM build as install
USER 0:0
RUN make DESTDIR="/rootfs" install
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -0,0 +1,32 @@
ARG REGISTRY=local
FROM ${REGISTRY}/python as python
FROM ${REGISTRY}/py-setuptools as py-setuptools
FROM ${REGISTRY}/zlib as zlib
FROM busybox as base
ENV VERSION=1.3.1
ENV SRC_FILE=meson-${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/mesonbuild/meson/releases/download/${VERSION}/${SRC_FILE}
ENV SRC_HASH=6020568bdede1643d4fb41e28215be38eff5d52da28ac7d125457c59e0032ad7
COPY --from=python . /
COPY --from=py-setuptools . /
COPY --from=zlib . /
FROM base as fetch
RUN set -eux; \
wget ${SRC_SITE}; \
echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN tar -xf ${SRC_FILE}
WORKDIR meson-${VERSION}
RUN python setup.py build;
FROM build as install
USER 0:0
RUN set -eux; \
python setup.py install --root=/rootfs; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View File

@ -0,0 +1,54 @@
ARG REGISTRY=local
FROM ${REGISTRY}/busybox as busybox
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/binutils as binutils
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/make as make
FROM ${REGISTRY}/autoconf as autoconf
FROM ${REGISTRY}/automake as automake
FROM ${REGISTRY}/libtool as libtool
FROM ${REGISTRY}/m4 as m4
FROM ${REGISTRY}/pkgconf as pkgconf
FROM busybox as base
ENV VERSION=1.2.7
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/void-linux/musl-fts/archive/refs/tags/${SRC_FILE}
ENV SRC_HASH=49ae567a96dbab22823d045ffebe0d6b14b9b799925e9ca9274d47d26ff482a6
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=autoconf . /
COPY --from=automake . /
COPY --from=libtool . /
COPY --from=pkgconf . /
COPY --from=m4 . /
FROM base as fetch
RUN wget ${SRC_SITE}
RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN tar -xzf ${SRC_FILE}
WORKDIR musl-fts-${VERSION}
RUN set -eux; \
./bootstrap.sh; \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var; \
make
FROM build as install
USER 0:0
RUN set -eux; \
make DESTDIR=/rootfs install; \
install -Dm644 musl-fts.pc -t /rootfs/usr/lib/pkgconfig/; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View File

@ -0,0 +1,47 @@
ARG REGISTRY=local
FROM ${REGISTRY}/busybox as busybox
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/binutils as binutils
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/make as make
FROM ${REGISTRY}/autoconf as autoconf
FROM ${REGISTRY}/automake as automake
FROM ${REGISTRY}/libtool as libtool
FROM ${REGISTRY}/m4 as m4
FROM ${REGISTRY}/pkgconf as pkgconf
FROM busybox as base
ENV VERSION=1.2.3
ENV SRC_FILE=v${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/void-linux/musl-obstack/archive/refs/tags/${SRC_FILE}
ENV SRC_HASH=9ffb3479b15df0170eba4480e51723c3961dbe0b461ec289744622db03a69395
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=autoconf . /
COPY --from=automake . /
COPY --from=libtool . /
COPY --from=pkgconf . /
COPY --from=m4 . /
FROM base as fetch
RUN wget ${SRC_SITE}
RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN tar -xzf ${SRC_FILE}
WORKDIR musl-obstack-${VERSION}
RUN set -eux; \
./bootstrap.sh; \
./configure --prefix=/usr; \
make
FROM build as install
USER 0:0
RUN set -eux; \
make DESTDIR=/rootfs install; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View File

@ -1,7 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/stage3:latest as stage3
FROM stage3 as base
FROM stagex/stage3 as base
ENV SRC_SITE http://musl.libc.org
ENV SRC_VERSION 1.2.4
ENV SRC_HASH 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
@ -17,11 +14,11 @@ RUN echo "${SRC_HASH} musl-${SRC_VERSION}.tar.gz" | sha256sum -c
FROM fetch as build
RUN tar -xzf musl-${SRC_VERSION}.tar.gz
WORKDIR musl-${SRC_VERSION}
ADD lfs64.patch .
ADD lfs64-2.patch .
ADD *.patch .
RUN set -eux; \
patch -p1 < lfs64.patch; \
patch -p1 < lfs64-2.patch; \
patch -p1 < relr-typedefs.patch; \
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \

View File

@ -0,0 +1,28 @@
From 981144ebc9ff30b085af107f1337543de7b0bf94 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 6 Nov 2023 12:29:16 +0100
Subject: [PATCH] elf.h: add typedefs for Elf*_Relr
Add typedefs for Elf32_Relr and Elf64_relr as a follow-up to commit
d32dadd60efb (ldso: support DT_RELR relative relocation format)
---
include/elf.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/elf.h b/include/elf.h
index 23f2c4bc..aa186d9d 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -32,6 +32,9 @@ typedef uint16_t Elf64_Section;
typedef Elf32_Half Elf32_Versym;
typedef Elf64_Half Elf64_Versym;
+typedef Elf32_Word Elf32_Relr;
+typedef Elf64_Xword Elf64_Relr;
+
#define EI_NIDENT (16)
typedef struct {
--
2.42.1

View File

@ -1,23 +1,13 @@
ARG REGISTRY=local
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/python:latest as python
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/busybox:latest as busybox
FROM ${REGISTRY}/ca-certificates:latest as ca-certificates
FROM ${REGISTRY}/openssl:latest as openssl
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://github.com/martine/ninja/archive/
ENV SRC_VERSION=1.9.0
ENV SRC_HASH=5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9
COPY --from=binutils . /
COPY --from=make . /
COPY --from=python . /
COPY --from=musl . /
COPY --from=gcc . /
COPY --from=openssl . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/python . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/openssl . /
FROM ${REGISTRY}/busybox:latest as busybox
FROM base as fetch
@ -30,7 +20,7 @@ WORKDIR ninja-${SRC_VERSION}
ADD fix-musl.patch .
RUN patch -p1 < fix-musl.patch
# HACK: figure out why gcc package puts these in the wrong path at install time
COPY --from=gcc /usr/lib64/* /usr/lib/
COPY --from=stagex/gcc /usr/lib64/* /usr/lib/
RUN set -eux; \
python3 ./configure.py --bootstrap
@ -40,8 +30,8 @@ RUN set -eux; \
mkdir -p /rootfs/usr/bin/; \
cp ninja /rootfs/usr/bin/
# HACK: figure out why gcc package puts these in the wrong path at install time
COPY --from=gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=musl . /rootfs/
COPY --from=stagex/gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=stagex/musl . /rootfs/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,22 +1,13 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/perl:latest as perl
FROM ${REGISTRY}/linux-headers:latest as linux-headers
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://www.openssl.org/source
ENV SRC_VERSION=3.0.12
ENV SRC_HASH=f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=perl . /
COPY --from=linux-headers . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/perl . /
COPY --from=stagex/linux-headers . /
FROM base as fetch
RUN wget ${SRC_SITE}/openssl-${SRC_VERSION}.tar.gz

View File

@ -1,18 +1,11 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://www.cpan.org/src/5.0
ENV SRC_VERSION=5.38.0
ENV SRC_HASH=eca551caec3bc549a4e590c0015003790bdd1a604ffe19cc78ee631d51f7072e
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
FROM base as fetch
RUN wget ${SRC_SITE}/perl-${SRC_VERSION}.tar.xz
@ -63,7 +56,7 @@ USER 0:0
RUN set -eux; \
make DESTDIR=/rootfs install; \
mkdir -p /rootfs/lib
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,18 +1,11 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://distfiles.ariadne.space/pkgconf/
ENV SRC_VERSION=1.6.3
ENV SRC_HASH=61f0b31b0d5ea0e862b454a80c170f57bad47879c0c42bd8de89200ff62ea210
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
FROM base as fetch
RUN wget ${SRC_SITE}/pkgconf-${SRC_VERSION}.tar.xz
@ -31,7 +24,7 @@ USER 0:0
RUN set -eux; \
make DESTDIR=/rootfs install; \
ln -s pkgconf /rootfs/usr/bin/pkg-config
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,12 +1,9 @@
ARG REGISTRY=local
FROM ${REGISTRY}/python:latest as python
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://pypi.io/packages/source/s/setuptools
ENV SRC_VERSION=68.2.2
ENV SRC_HASH=4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87
COPY --from=python . /
COPY --from=stagex/python . /
COPY --from=stagex/zlib . /
FROM base as fetch
RUN wget ${SRC_SITE}/setuptools-${SRC_VERSION}.tar.gz

View File

@ -1,12 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/openssl:latest as openssl
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://www.python.org/ftp/python
ENV SRC_VERSION=3.12.0
ENV SRC_HASH=795c34f44df45a0e9b9710c8c71c15c671871524cd412ca14def212e8ccb155d
@ -18,11 +10,12 @@ RUN echo "${SRC_HASH} Python-${SRC_VERSION}.tar.xz" | sha256sum -c
FROM fetch as build
RUN tar -xf Python-${SRC_VERSION}.tar.xz
WORKDIR Python-${SRC_VERSION}
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=openssl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . /
ENV PYTHONHASHSEED=0
ENV PYTHONDONTWRITEBYTECODE=1
RUN set -eux; \
@ -40,7 +33,7 @@ USER 0:0
RUN set -eux; \
make DESTDIR=/rootfs install; \
ln -s /usr/bin/python3 /rootfs/usr/bin/python
COPY --from=musl . /rootfs/
COPY --from=stagex/musl . /rootfs/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,24 +1,8 @@
ARG REGISTRY=local
ARG VERSION=1.74.0
ARG BUILD_VERSION=1.73.0
ARG LLVM_VERSION=13.0.1
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/binutils as binutils
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/bash as bash
FROM ${REGISTRY}/make as make
FROM ${REGISTRY}/cmake as cmake
FROM ${REGISTRY}/perl as perl
FROM ${REGISTRY}/libunwind as libunwind
FROM ${REGISTRY}/python as python
FROM ${REGISTRY}/py-setuptools as py-setuptools
FROM ${REGISTRY}/zlib as zlib
FROM ${REGISTRY}/openssl as openssl
FROM ${REGISTRY}/pkgconf as pkgconf
FROM ${REGISTRY}/llvm:${LLVM_VERSION} as llvm
FROM ${REGISTRY}/busybox as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV BOOTSTRAP_VERSION=1.54.0
ENV SRC_SITE=https://static.rust-lang.org/dist
ENV MRUSTC_VERSION=16d744fd62e74a2d4356df864b5850bf782918da
@ -53,20 +37,20 @@ ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}
ARG LLVM_VERSION
ENV LLVM_VERSION=${LLVM_VERSION}
COPY --from=binutils . /
COPY --from=bash . /
COPY --from=make . /
COPY --from=cmake . /
COPY --from=python . /
COPY --from=py-setuptools . /
COPY --from=zlib . /
COPY --from=pkgconf . /
COPY --from=openssl . /
COPY --from=llvm . /
COPY --from=perl . /
COPY --from=gcc . /
COPY --from=libunwind . /
COPY --from=musl . /
COPY --from=stagex/binutils . /
COPY --from=stagex/bash . /
COPY --from=stagex/make . /
COPY --from=stagex/cmake . /
COPY --from=stagex/python . /
COPY --from=stagex/py-setuptools . /
COPY --from=stagex/zlib . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/openssl . /
COPY --from=stagex/llvm . /
COPY --from=stagex/perl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/musl . /
FROM base as bootstrap-fetch
RUN set -eux; \
@ -109,9 +93,9 @@ RUN set -eux; \
mv /rootfs/bin/cargo /rootfs/usr/bin/; \
mv /rootfs/lib/rustlib /rootfs/usr/lib/rustlib; \
mv /rootfs/usr/lib/rustlib/x86_64-unknown-linux-musl/lib/librustc_driver.so /rootfs/usr/lib/
COPY --from=musl /lib/* /rootfs/lib/
COPY --from=gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=stagex/musl /lib/* /rootfs/lib/
COPY --from=stagex/gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=stagex/gcc /usr/lib64/* /rootfs/usr/lib/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as bootstrap-package
@ -181,10 +165,10 @@ RUN set -eux; \
manifest-rust-std-x86_64-unknown-linux-musl \
manifest-rust-std-x86_64-unknown-linux-musl; \
rm -f x86_64-unknown-linux-musl/lib/self-contained/libunwind.a
COPY --from=musl /lib/* /rootfs/lib/
COPY --from=gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=llvm /usr/lib/* /rootfs/usr/lib/
COPY --from=stagex/musl /lib/* /rootfs/lib/
COPY --from=stagex/gcc /usr/lib/* /rootfs/usr/lib/
COPY --from=stagex/gcc /usr/lib64/* /rootfs/usr/lib/
COPY --from=stagex/llvm /usr/lib/* /rootfs/usr/lib/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,19 +1,11 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/bash:latest as bash
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://ftp.gnu.org/gnu/sed
ENV SRC_VERSION=4.9
ENV SRC_HASH=6e226b732e1cd739464ad6862bd1a1aba42d7982922da7a53519631d24975181
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
FROM base as fetch
RUN wget ${SRC_SITE}/sed-${SRC_VERSION}.tar.xz
@ -30,7 +22,7 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN make DESTDIR=/rootfs install
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,18 +1,11 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://www.zlib.net/
ENV SRC_VERSION=1.3.1
ENV SRC_HASH=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
FROM base as fetch
RUN wget ${SRC_SITE}/zlib-${SRC_VERSION}.tar.gz

View File

@ -1,6 +1,18 @@
.PHONY: nitro
nitro: \
out/linux-nitro.tgz
.PHONY: linux
linux: \
out/linux-generic.tgz
out/linux-nitro.tgz: out/linux-nitro.tgz
$(call build,kernel,linux-nitro)
out/linux-generic.tgz: \
out/gcc.tgz \
out/binutils.tgz \
out/make.tgz \
out/musl.tgz \
out/bison.tgz \
out/pkgconf.tgz \
out/libzstd.tgz \
out/openssl.tgz \
out/perl.tgz \
out/zlib.tgz \
out/flex.tgz \
out/libelf.tgz
$(call build,kernel,linux-generic)

View File

@ -0,0 +1,40 @@
FROM stagex/busybox as base
WORKDIR ${HOME}
ENV SRC_SITE http://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/
ENV SRC_VERSION 6.6
ENV SRC_HASH d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
FROM base as fetch
RUN wget ${SRC_SITE}/linux-${SRC_VERSION}.tar.xz
RUN echo "${SRC_HASH} linux-${SRC_VERSION}.tar.xz" | sha256sum -c
FROM fetch as build
RUN tar -xf linux-${SRC_VERSION}.tar.xz
WORKDIR linux-${SRC_VERSION}
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/binutils . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/elfutils . /
COPY --from=stagex/openssl . /
COPY --from=stagex/perl . /
COPY --from=stagex/m4 . /
COPY --from=stagex/gcc . /
COPY --from=stagex/bison . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/zlib . /
COPY --from=stagex/flex . /
COPY --from=stagex/pkgconf . /
RUN set -eux; \
make oldconfig
RUN make
FROM build as install
USER 0:0
RUN set -eux; \
make DESTDIR=/rootfs install; \
mkdir -p /rootfs/usr; \
find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /

View File

@ -1,29 +0,0 @@
ARG REGISTRY=local
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/stage3:latest as stage3
FROM stage3 as base
WORKDIR ${HOME}
ENV SRC_SITE https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/
ENV SRC_VERSION 6.6
ENV SRC_HASH d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
FROM base as fetch
RUN wget ${SRC_SITE}/linux-${SRC_VERSION}.tar.xz
RUN echo "${SRC_HASH} linux-${SRC_VERSION}.tar.xz" | sha256sum -c
FROM fetch as build
RUN tar -xf linux-${SRC_VERSION}.tar.xz
WORKDIR linux-${SRC_VERSION}
RUN make oldconfig default
FROM build as package
#FROM build as install
#USER 0:0
#RUN set -eux; \
# mkdir -p /rootfs/usr; \
# find /rootfs -exec touch -hcd "@0" "{}" +
#
#FROM scratch as package
#COPY --from=install /rootfs /

View File

@ -1,5 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/busybox:latest as base
FROM stagex/busybox as base
FROM base as install
USER 0:0

View File

@ -1,30 +1,17 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/autoconf:latest as autoconf
FROM ${REGISTRY}/automake:latest as automake
FROM ${REGISTRY}/libtool:latest as libtool
FROM ${REGISTRY}/pkgconf:latest as pkgconf
FROM ${REGISTRY}/python:latest as python
FROM ${REGISTRY}/m4:latest as m4
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://gitlab.gnome.org/GNOME/libxml2/-/archive
ENV SRC_VERSION=2.12.1
ENV SRC_HASH=1090e62c5a1900429f63e4681263b96e7829876ccbc66cf2d9266cd589f67286
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=python . /
COPY --from=autoconf . /
COPY --from=automake . /
COPY --from=pkgconf . /
COPY --from=libtool . /
COPY --from=m4 . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/python . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/libtool . /
COPY --from=stagex/m4 . /
FROM base as fetch
RUN wget ${SRC_SITE}/v${SRC_VERSION}/libxml2-v${SRC_VERSION}.tar.gz

View File

@ -43,7 +43,9 @@ define build
--target $(TARGET) \
$(EXTRA_ARGS) \
$(NOCACHE_FLAG) \
-f src/$(CATEGORY)/$(NAME)/Containerfile \
src/$(CATEGORY)/$(NAME) \
&& tar -tf $(basename $@).tar \
&& gzip < $(basename $@).tar > $@ \
&& rm $(basename $@).tar \
&& gunzip -c $@ | docker load; \

View File

@ -1,11 +1,4 @@
ARG REGISTRY=local
from ${REGISTRY}/binutils as binutils
from ${REGISTRY}/gcc as gcc
from ${REGISTRY}/musl as musl
from ${REGISTRY}/make as make
from ${REGISTRY}/busybox as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://ftp.gnu.org/gnu/cpio
ENV SRC_VERSION=2.15
ENV SRC_HASH=efa50ef983137eefc0a02fdb51509d624b5e3295c980aa127ceee4183455499e
@ -19,10 +12,10 @@ RUN set -eux; \
FROM fetch as build
RUN tar -xzf ${SRC_FILE}
WORKDIR cpio-${SRC_VERSION}
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
RUN set -eux; \
mkdir -p /home/user/rootfs/lib; \
./configure \
@ -37,7 +30,7 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN make DESTDIR=/rootfs install
COPY --from=musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
COPY --from=stagex/musl /usr/lib/libc.so /rootfs/lib/ld-musl-x86_64.so.1
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,21 +1,12 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/openssl:latest as openssl
FROM ${REGISTRY}/ca-certificates:latest as ca-certificates
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
FROM stagex/busybox as base
ENV SRC_SITE=https://curl.se/download
ENV SRC_VERSION=8.4.0
ENV SRC_HASH=16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
COPY --from=gcc . /
COPY --from=openssl . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/openssl . /
FROM base as fetch
RUN wget ${SRC_SITE}/curl-${SRC_VERSION}.tar.xz
@ -40,9 +31,9 @@ RUN set -eux; \
FROM build as install
USER 0:0
RUN make install DESTDIR=/rootfs
COPY --from=musl . /rootfs/
COPY --from=openssl . /rootfs/
COPY --from=ca-certificates . /rootfs/
COPY --from=stagex/musl . /rootfs/
COPY --from=stagex/openssl . /rootfs/
COPY --from=stagex/ca-certificates . /rootfs/
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package

View File

@ -1,10 +1,4 @@
ARG REGISTRY=local
FROM ${REGISTRY}/musl as musl
FROM ${REGISTRY}/gcc as gcc
FROM ${REGISTRY}/binutils as binutils
FROM ${REGISTRY}/busybox as busybox
FROM busybox as base
FROM stagex/busybox as base
WORKDIR ${HOME}
ENV SRC_SITE http://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/
ENV SRC_VERSION 6.6
@ -17,9 +11,9 @@ RUN echo "${SRC_HASH} linux-${SRC_VERSION}.tar.xz" | sha256sum -c
FROM fetch as build
RUN tar -xf linux-${SRC_VERSION}.tar.xz
WORKDIR linux-${SRC_VERSION}
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
RUN gcc usr/gen_init_cpio.c -o usr/gen_init_cpio
FROM build as install

View File

@ -1,22 +1,16 @@
ARG REGISTRY=local
FROM ${REGISTRY}/go:latest as go
FROM ${REGISTRY}/busybox:latest as busybox
FROM ${REGISTRY}/ca-certificates:latest as ca-certificates
FROM busybox as base
FROM stagex/busybox as base
ENV VERSION=3.8.1
ENV SRC_SITE=https://github.com/getsops/sops/archive/refs/tags
ENV SRC_HASH=5ca70fb4f96797d09012c705a5bb935835896de7bcd063b98d498912b0e645a0
RUN echo ${SRC_SITE}/${VERSION}.tar.gz
FROM base as fetch
COPY --from=go . /
COPY --from=ca-certificates . /
COPY --from=stagex/go . /
COPY --from=stagex/ca-certificates . /
RUN set -eux; \
wget ${SRC_SITE}/v${VERSION}.tar.gz; \
echo "${SRC_HASH} v${VERSION}.tar.gz" | sha256sum -c;
echo "${SRC_HASH} v${VERSION}.tar.gz" | sha256sum -c;
FROM fetch as build
RUN tar -xvf v${VERSION}.tar.gz
@ -31,7 +25,7 @@ ENV GOSUMDB=sum.golang.org
ENV CGO_ENABLED=0
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
ENV GOFLAGS=-trimpath
ENV GOFLAGS=-trimpath
RUN mkdir -p ${GOPATH}
RUN go build -o bin/sops ./cmd/sops
@ -43,4 +37,4 @@ RUN cp bin/sops /rootfs/usr/bin/
FROM scratch as package
COPY --from=install /rootfs/ /
ENTRYPOINT ["/usr/bin/sops"]
CMD ["--version"]
CMD ["--version"]

View File

@ -1,21 +1,16 @@
ARG REGISTRY=local
FROM ${REGISTRY}/go:latest as go
FROM ${REGISTRY}/busybox:latest as busybox
FROM ${REGISTRY}/ca-certificates:latest as ca-certificates
FROM busybox as base
FROM stagex/busybox as base
ENV VERSION=1.6.0-beta4
ENV SRC_SITE=https://github.com/opentofu/opentofu/archive/refs/tags
ENV SRC_HASH=b14f151839d90d06f95ba4257be159857606daf522d99e9285ddb248f814393f
RUN echo ${SRC_SITE}/${VERSION}.tar.gz
FROM base as fetch
COPY --from=go . /
COPY --from=ca-certificates . /
COPY --from=stagex/go . /
COPY --from=stagex/ca-certificates . /
RUN set -eux; \
wget ${SRC_SITE}/v${VERSION}.tar.gz; \
echo "${SRC_HASH} v${VERSION}.tar.gz" | sha256sum -c;
echo "${SRC_HASH} v${VERSION}.tar.gz" | sha256sum -c;
FROM fetch as build
RUN tar -xvf v${VERSION}.tar.gz
@ -30,7 +25,7 @@ ENV GOSUMDB=sum.golang.org
ENV CGO_ENABLED=0
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
ENV GOFLAGS=-trimpath
ENV GOFLAGS=-trimpath
RUN mkdir -p ${GOPATH}
RUN go build -o bin/tofu ./cmd/tofu
@ -42,4 +37,4 @@ RUN cp bin/tofu /rootfs/usr/bin/
FROM scratch as package
COPY --from=install /rootfs/ /
ENTRYPOINT ["/usr/bin/tofu"]
CMD ["--version"]
CMD ["--version"]