From 77452b3995050848e062166f0d035c14ecda9414 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Mon, 5 Feb 2024 01:45:20 -0800 Subject: [PATCH 1/3] Dockerfile -> Containerfile --- src/bootstrap/stage0/{Dockerfile => Containerfile} | 0 src/bootstrap/stage1/{Dockerfile => Containerfile} | 0 src/bootstrap/stage2/{Dockerfile => Containerfile} | 0 src/bootstrap/stage3/{Dockerfile => Containerfile} | 0 src/core/_tests/go/{Dockerfile => Containerfile} | 0 src/core/_tests/perl/{Dockerfile => Containerfile} | 0 src/core/_tests/python/{Dockerfile => Containerfile} | 0 src/core/_tests/rust/{Dockerfile => Containerfile} | 0 src/core/autoconf/{Dockerfile => Containerfile} | 0 src/core/automake/{Dockerfile => Containerfile} | 0 src/core/bash/{Dockerfile => Containerfile} | 0 src/core/binutils/{Dockerfile => Containerfile} | 0 src/core/busybox/{Dockerfile => Containerfile} | 0 src/core/cmake/{Dockerfile => Containerfile} | 0 src/core/gcc/{Dockerfile => Containerfile} | 0 src/core/go/{Dockerfile => Containerfile} | 0 src/core/libtool/{Dockerfile => Containerfile} | 0 src/core/libunwind/{Dockerfile => Containerfile} | 0 src/core/linux-headers/{Dockerfile => Containerfile} | 0 src/core/llvm/{Dockerfile => Containerfile} | 0 src/core/m4/{Dockerfile => Containerfile} | 0 src/core/make/{Dockerfile => Containerfile} | 0 src/core/musl/{Dockerfile => Containerfile} | 0 src/core/ninja/{Dockerfile => Containerfile} | 0 src/core/openssl/{Dockerfile => Containerfile} | 0 src/core/perl/{Dockerfile => Containerfile} | 0 src/core/pkgconf/{Dockerfile => Containerfile} | 0 src/core/py-setuptools/{Dockerfile => Containerfile} | 0 src/core/python/{Dockerfile => Containerfile} | 0 src/core/rust/{Dockerfile => Containerfile} | 0 src/core/sed/{Dockerfile => Containerfile} | 0 src/core/zlib/{Dockerfile => Containerfile} | 0 src/libs/ca-certificates/{Dockerfile => Containerfile} | 0 src/libs/libxml2/{Dockerfile => Containerfile} | 0 src/tools/cpio/{Dockerfile => Containerfile} | 0 src/tools/curl/{Dockerfile => Containerfile} | 0 src/tools/gen_initramfs/{Dockerfile => Containerfile} | 0 src/tools/sops/{Dockerfile => Containerfile} | 0 src/tools/tofu/{Dockerfile => Containerfile} | 0 39 files changed, 0 insertions(+), 0 deletions(-) rename src/bootstrap/stage0/{Dockerfile => Containerfile} (100%) rename src/bootstrap/stage1/{Dockerfile => Containerfile} (100%) rename src/bootstrap/stage2/{Dockerfile => Containerfile} (100%) rename src/bootstrap/stage3/{Dockerfile => Containerfile} (100%) rename src/core/_tests/go/{Dockerfile => Containerfile} (100%) rename src/core/_tests/perl/{Dockerfile => Containerfile} (100%) rename src/core/_tests/python/{Dockerfile => Containerfile} (100%) rename src/core/_tests/rust/{Dockerfile => Containerfile} (100%) rename src/core/autoconf/{Dockerfile => Containerfile} (100%) rename src/core/automake/{Dockerfile => Containerfile} (100%) rename src/core/bash/{Dockerfile => Containerfile} (100%) rename src/core/binutils/{Dockerfile => Containerfile} (100%) rename src/core/busybox/{Dockerfile => Containerfile} (100%) rename src/core/cmake/{Dockerfile => Containerfile} (100%) rename src/core/gcc/{Dockerfile => Containerfile} (100%) rename src/core/go/{Dockerfile => Containerfile} (100%) rename src/core/libtool/{Dockerfile => Containerfile} (100%) rename src/core/libunwind/{Dockerfile => Containerfile} (100%) rename src/core/linux-headers/{Dockerfile => Containerfile} (100%) rename src/core/llvm/{Dockerfile => Containerfile} (100%) rename src/core/m4/{Dockerfile => Containerfile} (100%) rename src/core/make/{Dockerfile => Containerfile} (100%) rename src/core/musl/{Dockerfile => Containerfile} (100%) rename src/core/ninja/{Dockerfile => Containerfile} (100%) rename src/core/openssl/{Dockerfile => Containerfile} (100%) rename src/core/perl/{Dockerfile => Containerfile} (100%) rename src/core/pkgconf/{Dockerfile => Containerfile} (100%) rename src/core/py-setuptools/{Dockerfile => Containerfile} (100%) rename src/core/python/{Dockerfile => Containerfile} (100%) rename src/core/rust/{Dockerfile => Containerfile} (100%) rename src/core/sed/{Dockerfile => Containerfile} (100%) rename src/core/zlib/{Dockerfile => Containerfile} (100%) rename src/libs/ca-certificates/{Dockerfile => Containerfile} (100%) rename src/libs/libxml2/{Dockerfile => Containerfile} (100%) rename src/tools/cpio/{Dockerfile => Containerfile} (100%) rename src/tools/curl/{Dockerfile => Containerfile} (100%) rename src/tools/gen_initramfs/{Dockerfile => Containerfile} (100%) rename src/tools/sops/{Dockerfile => Containerfile} (100%) rename src/tools/tofu/{Dockerfile => Containerfile} (100%) diff --git a/src/bootstrap/stage0/Dockerfile b/src/bootstrap/stage0/Containerfile similarity index 100% rename from src/bootstrap/stage0/Dockerfile rename to src/bootstrap/stage0/Containerfile diff --git a/src/bootstrap/stage1/Dockerfile b/src/bootstrap/stage1/Containerfile similarity index 100% rename from src/bootstrap/stage1/Dockerfile rename to src/bootstrap/stage1/Containerfile diff --git a/src/bootstrap/stage2/Dockerfile b/src/bootstrap/stage2/Containerfile similarity index 100% rename from src/bootstrap/stage2/Dockerfile rename to src/bootstrap/stage2/Containerfile diff --git a/src/bootstrap/stage3/Dockerfile b/src/bootstrap/stage3/Containerfile similarity index 100% rename from src/bootstrap/stage3/Dockerfile rename to src/bootstrap/stage3/Containerfile diff --git a/src/core/_tests/go/Dockerfile b/src/core/_tests/go/Containerfile similarity index 100% rename from src/core/_tests/go/Dockerfile rename to src/core/_tests/go/Containerfile diff --git a/src/core/_tests/perl/Dockerfile b/src/core/_tests/perl/Containerfile similarity index 100% rename from src/core/_tests/perl/Dockerfile rename to src/core/_tests/perl/Containerfile diff --git a/src/core/_tests/python/Dockerfile b/src/core/_tests/python/Containerfile similarity index 100% rename from src/core/_tests/python/Dockerfile rename to src/core/_tests/python/Containerfile diff --git a/src/core/_tests/rust/Dockerfile b/src/core/_tests/rust/Containerfile similarity index 100% rename from src/core/_tests/rust/Dockerfile rename to src/core/_tests/rust/Containerfile diff --git a/src/core/autoconf/Dockerfile b/src/core/autoconf/Containerfile similarity index 100% rename from src/core/autoconf/Dockerfile rename to src/core/autoconf/Containerfile diff --git a/src/core/automake/Dockerfile b/src/core/automake/Containerfile similarity index 100% rename from src/core/automake/Dockerfile rename to src/core/automake/Containerfile diff --git a/src/core/bash/Dockerfile b/src/core/bash/Containerfile similarity index 100% rename from src/core/bash/Dockerfile rename to src/core/bash/Containerfile diff --git a/src/core/binutils/Dockerfile b/src/core/binutils/Containerfile similarity index 100% rename from src/core/binutils/Dockerfile rename to src/core/binutils/Containerfile diff --git a/src/core/busybox/Dockerfile b/src/core/busybox/Containerfile similarity index 100% rename from src/core/busybox/Dockerfile rename to src/core/busybox/Containerfile diff --git a/src/core/cmake/Dockerfile b/src/core/cmake/Containerfile similarity index 100% rename from src/core/cmake/Dockerfile rename to src/core/cmake/Containerfile diff --git a/src/core/gcc/Dockerfile b/src/core/gcc/Containerfile similarity index 100% rename from src/core/gcc/Dockerfile rename to src/core/gcc/Containerfile diff --git a/src/core/go/Dockerfile b/src/core/go/Containerfile similarity index 100% rename from src/core/go/Dockerfile rename to src/core/go/Containerfile diff --git a/src/core/libtool/Dockerfile b/src/core/libtool/Containerfile similarity index 100% rename from src/core/libtool/Dockerfile rename to src/core/libtool/Containerfile diff --git a/src/core/libunwind/Dockerfile b/src/core/libunwind/Containerfile similarity index 100% rename from src/core/libunwind/Dockerfile rename to src/core/libunwind/Containerfile diff --git a/src/core/linux-headers/Dockerfile b/src/core/linux-headers/Containerfile similarity index 100% rename from src/core/linux-headers/Dockerfile rename to src/core/linux-headers/Containerfile diff --git a/src/core/llvm/Dockerfile b/src/core/llvm/Containerfile similarity index 100% rename from src/core/llvm/Dockerfile rename to src/core/llvm/Containerfile diff --git a/src/core/m4/Dockerfile b/src/core/m4/Containerfile similarity index 100% rename from src/core/m4/Dockerfile rename to src/core/m4/Containerfile diff --git a/src/core/make/Dockerfile b/src/core/make/Containerfile similarity index 100% rename from src/core/make/Dockerfile rename to src/core/make/Containerfile diff --git a/src/core/musl/Dockerfile b/src/core/musl/Containerfile similarity index 100% rename from src/core/musl/Dockerfile rename to src/core/musl/Containerfile diff --git a/src/core/ninja/Dockerfile b/src/core/ninja/Containerfile similarity index 100% rename from src/core/ninja/Dockerfile rename to src/core/ninja/Containerfile diff --git a/src/core/openssl/Dockerfile b/src/core/openssl/Containerfile similarity index 100% rename from src/core/openssl/Dockerfile rename to src/core/openssl/Containerfile diff --git a/src/core/perl/Dockerfile b/src/core/perl/Containerfile similarity index 100% rename from src/core/perl/Dockerfile rename to src/core/perl/Containerfile diff --git a/src/core/pkgconf/Dockerfile b/src/core/pkgconf/Containerfile similarity index 100% rename from src/core/pkgconf/Dockerfile rename to src/core/pkgconf/Containerfile diff --git a/src/core/py-setuptools/Dockerfile b/src/core/py-setuptools/Containerfile similarity index 100% rename from src/core/py-setuptools/Dockerfile rename to src/core/py-setuptools/Containerfile diff --git a/src/core/python/Dockerfile b/src/core/python/Containerfile similarity index 100% rename from src/core/python/Dockerfile rename to src/core/python/Containerfile diff --git a/src/core/rust/Dockerfile b/src/core/rust/Containerfile similarity index 100% rename from src/core/rust/Dockerfile rename to src/core/rust/Containerfile diff --git a/src/core/sed/Dockerfile b/src/core/sed/Containerfile similarity index 100% rename from src/core/sed/Dockerfile rename to src/core/sed/Containerfile diff --git a/src/core/zlib/Dockerfile b/src/core/zlib/Containerfile similarity index 100% rename from src/core/zlib/Dockerfile rename to src/core/zlib/Containerfile diff --git a/src/libs/ca-certificates/Dockerfile b/src/libs/ca-certificates/Containerfile similarity index 100% rename from src/libs/ca-certificates/Dockerfile rename to src/libs/ca-certificates/Containerfile diff --git a/src/libs/libxml2/Dockerfile b/src/libs/libxml2/Containerfile similarity index 100% rename from src/libs/libxml2/Dockerfile rename to src/libs/libxml2/Containerfile diff --git a/src/tools/cpio/Dockerfile b/src/tools/cpio/Containerfile similarity index 100% rename from src/tools/cpio/Dockerfile rename to src/tools/cpio/Containerfile diff --git a/src/tools/curl/Dockerfile b/src/tools/curl/Containerfile similarity index 100% rename from src/tools/curl/Dockerfile rename to src/tools/curl/Containerfile diff --git a/src/tools/gen_initramfs/Dockerfile b/src/tools/gen_initramfs/Containerfile similarity index 100% rename from src/tools/gen_initramfs/Dockerfile rename to src/tools/gen_initramfs/Containerfile diff --git a/src/tools/sops/Dockerfile b/src/tools/sops/Containerfile similarity index 100% rename from src/tools/sops/Dockerfile rename to src/tools/sops/Containerfile diff --git a/src/tools/tofu/Dockerfile b/src/tools/tofu/Containerfile similarity index 100% rename from src/tools/tofu/Dockerfile rename to src/tools/tofu/Containerfile From cf04bfc6e6ce8fb93383d6b5ad6c88c0669b9c0c Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Mon, 5 Feb 2024 01:45:45 -0800 Subject: [PATCH 2/3] don't gzip unless we have a valid tar file --- src/macros.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/macros.mk b/src/macros.mk index 937ca8b..a64c404 100644 --- a/src/macros.mk +++ b/src/macros.mk @@ -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; \ From 6c9088c55ccc0b6fc0d0d72f69c5b91594399955 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Mon, 5 Feb 2024 02:36:12 -0800 Subject: [PATCH 3/3] remove custom image overrides from each Dockerfile, favoring build contexts --- src/bootstrap/stage1/Containerfile | 3 +- src/bootstrap/stage2/Containerfile | 5 +-- src/bootstrap/stage3/Containerfile | 5 +-- src/core/autoconf/Containerfile | 25 ++++------- src/core/automake/Containerfile | 30 +++++-------- src/core/bash/Containerfile | 19 +++----- src/core/binutils/Containerfile | 8 +--- src/core/busybox/Containerfile | 5 +-- src/core/cmake/Containerfile | 38 ++++++---------- src/core/gcc/Containerfile | 13 ++---- src/core/go/Containerfile | 19 +++----- src/core/libtool/Containerfile | 28 ++++-------- src/core/libunwind/Containerfile | 26 ++++------- src/core/linux-headers/Containerfile | 6 +-- src/core/llvm/Containerfile | 36 ++++++---------- src/core/m4/Containerfile | 19 +++----- src/core/make/Containerfile | 8 +--- src/core/musl/Containerfile | 5 +-- src/core/ninja/Containerfile | 30 +++++-------- src/core/openssl/Containerfile | 23 +++------- src/core/perl/Containerfile | 19 +++----- src/core/pkgconf/Containerfile | 19 +++----- src/core/py-setuptools/Containerfile | 8 +--- src/core/python/Containerfile | 22 +++------- src/core/rust/Containerfile | 60 ++++++++++---------------- src/core/sed/Containerfile | 20 +++------ src/core/zlib/Containerfile | 17 +++----- src/libs/ca-certificates/Containerfile | 3 +- src/libs/libxml2/Containerfile | 35 +++++---------- src/tools/cpio/Containerfile | 19 +++----- src/tools/curl/Containerfile | 27 ++++-------- src/tools/gen_initramfs/Containerfile | 14 ++---- src/tools/sops/Containerfile | 18 +++----- src/tools/tofu/Containerfile | 17 +++----- 34 files changed, 205 insertions(+), 444 deletions(-) diff --git a/src/bootstrap/stage1/Containerfile b/src/bootstrap/stage1/Containerfile index f08ae2c..de04791 100644 --- a/src/bootstrap/stage1/Containerfile +++ b/src/bootstrap/stage1/Containerfile @@ -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 diff --git a/src/bootstrap/stage2/Containerfile b/src/bootstrap/stage2/Containerfile index 63e4152..638f801 100644 --- a/src/bootstrap/stage2/Containerfile +++ b/src/bootstrap/stage2/Containerfile @@ -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 diff --git a/src/bootstrap/stage3/Containerfile b/src/bootstrap/stage3/Containerfile index 66571ab..0d70497 100644 --- a/src/bootstrap/stage3/Containerfile +++ b/src/bootstrap/stage3/Containerfile @@ -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 diff --git a/src/core/autoconf/Containerfile b/src/core/autoconf/Containerfile index a91ce8e..23d1a9a 100644 --- a/src/core/autoconf/Containerfile +++ b/src/core/autoconf/Containerfile @@ -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 diff --git a/src/core/automake/Containerfile b/src/core/automake/Containerfile index 44ec32f..bd8d1df 100644 --- a/src/core/automake/Containerfile +++ b/src/core/automake/Containerfile @@ -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 diff --git a/src/core/bash/Containerfile b/src/core/bash/Containerfile index 56c8582..c519524 100644 --- a/src/core/bash/Containerfile +++ b/src/core/bash/Containerfile @@ -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 diff --git a/src/core/binutils/Containerfile b/src/core/binutils/Containerfile index 5c5286d..d8b52d0 100644 --- a/src/core/binutils/Containerfile +++ b/src/core/binutils/Containerfile @@ -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 diff --git a/src/core/busybox/Containerfile b/src/core/busybox/Containerfile index f889b6f..3ea1da8 100644 --- a/src/core/busybox/Containerfile +++ b/src/core/busybox/Containerfile @@ -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 diff --git a/src/core/cmake/Containerfile b/src/core/cmake/Containerfile index 9d20904..33fc80c 100644 --- a/src/core/cmake/Containerfile +++ b/src/core/cmake/Containerfile @@ -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 diff --git a/src/core/gcc/Containerfile b/src/core/gcc/Containerfile index 821e372..6295cdf 100644 --- a/src/core/gcc/Containerfile +++ b/src/core/gcc/Containerfile @@ -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; \ diff --git a/src/core/go/Containerfile b/src/core/go/Containerfile index 85e7c84..f7dc9ee 100644 --- a/src/core/go/Containerfile +++ b/src/core/go/Containerfile @@ -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; \ diff --git a/src/core/libtool/Containerfile b/src/core/libtool/Containerfile index fa90ea5..312b14e 100644 --- a/src/core/libtool/Containerfile +++ b/src/core/libtool/Containerfile @@ -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" "{}" + diff --git a/src/core/libunwind/Containerfile b/src/core/libunwind/Containerfile index 1c69209..d771716 100644 --- a/src/core/libunwind/Containerfile +++ b/src/core/libunwind/Containerfile @@ -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 diff --git a/src/core/linux-headers/Containerfile b/src/core/linux-headers/Containerfile index 98fdd8a..e105be3 100644 --- a/src/core/linux-headers/Containerfile +++ b/src/core/linux-headers/Containerfile @@ -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 diff --git a/src/core/llvm/Containerfile b/src/core/llvm/Containerfile index dd68417..963f2f0 100644 --- a/src/core/llvm/Containerfile +++ b/src/core/llvm/Containerfile @@ -1,31 +1,19 @@ -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/openssl . / FROM base as fetch RUN wget --no-check-certificate ${SRC_SITE}/llvmorg-${SRC_VERSION}/llvm-project-${SRC_VERSION}.src.tar.xz @@ -79,9 +67,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" "{}" + diff --git a/src/core/m4/Containerfile b/src/core/m4/Containerfile index c245549..f9dad10 100644 --- a/src/core/m4/Containerfile +++ b/src/core/m4/Containerfile @@ -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 diff --git a/src/core/make/Containerfile b/src/core/make/Containerfile index 33f9e74..e3c5f55 100644 --- a/src/core/make/Containerfile +++ b/src/core/make/Containerfile @@ -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 diff --git a/src/core/musl/Containerfile b/src/core/musl/Containerfile index 74128d6..b7f2546 100644 --- a/src/core/musl/Containerfile +++ b/src/core/musl/Containerfile @@ -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 diff --git a/src/core/ninja/Containerfile b/src/core/ninja/Containerfile index e193b8b..1f2fa4e 100644 --- a/src/core/ninja/Containerfile +++ b/src/core/ninja/Containerfile @@ -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 diff --git a/src/core/openssl/Containerfile b/src/core/openssl/Containerfile index fc7c929..69a99ff 100644 --- a/src/core/openssl/Containerfile +++ b/src/core/openssl/Containerfile @@ -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 diff --git a/src/core/perl/Containerfile b/src/core/perl/Containerfile index a6632b8..34c2236 100644 --- a/src/core/perl/Containerfile +++ b/src/core/perl/Containerfile @@ -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 diff --git a/src/core/pkgconf/Containerfile b/src/core/pkgconf/Containerfile index 29a6500..f4c6a7d 100644 --- a/src/core/pkgconf/Containerfile +++ b/src/core/pkgconf/Containerfile @@ -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 diff --git a/src/core/py-setuptools/Containerfile b/src/core/py-setuptools/Containerfile index dbd1e56..70c8694 100644 --- a/src/core/py-setuptools/Containerfile +++ b/src/core/py-setuptools/Containerfile @@ -1,12 +1,8 @@ -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 . / FROM base as fetch RUN wget ${SRC_SITE}/setuptools-${SRC_VERSION}.tar.gz diff --git a/src/core/python/Containerfile b/src/core/python/Containerfile index 118cbf0..e0329fa 100644 --- a/src/core/python/Containerfile +++ b/src/core/python/Containerfile @@ -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,11 @@ 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 . / ENV PYTHONHASHSEED=0 ENV PYTHONDONTWRITEBYTECODE=1 RUN set -eux; \ @@ -40,7 +32,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 diff --git a/src/core/rust/Containerfile b/src/core/rust/Containerfile index d4fa85e..f570dda 100644 --- a/src/core/rust/Containerfile +++ b/src/core/rust/Containerfile @@ -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 diff --git a/src/core/sed/Containerfile b/src/core/sed/Containerfile index dabf98b..e44bd49 100644 --- a/src/core/sed/Containerfile +++ b/src/core/sed/Containerfile @@ -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 diff --git a/src/core/zlib/Containerfile b/src/core/zlib/Containerfile index 2ac355f..eca10fc 100644 --- a/src/core/zlib/Containerfile +++ b/src/core/zlib/Containerfile @@ -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 diff --git a/src/libs/ca-certificates/Containerfile b/src/libs/ca-certificates/Containerfile index c3e70ad..cae0812 100644 --- a/src/libs/ca-certificates/Containerfile +++ b/src/libs/ca-certificates/Containerfile @@ -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 diff --git a/src/libs/libxml2/Containerfile b/src/libs/libxml2/Containerfile index 186029c..a1a5dd8 100644 --- a/src/libs/libxml2/Containerfile +++ b/src/libs/libxml2/Containerfile @@ -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 diff --git a/src/tools/cpio/Containerfile b/src/tools/cpio/Containerfile index 826c272..bb31b50 100644 --- a/src/tools/cpio/Containerfile +++ b/src/tools/cpio/Containerfile @@ -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 diff --git a/src/tools/curl/Containerfile b/src/tools/curl/Containerfile index 6bf148a..93fb525 100644 --- a/src/tools/curl/Containerfile +++ b/src/tools/curl/Containerfile @@ -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 diff --git a/src/tools/gen_initramfs/Containerfile b/src/tools/gen_initramfs/Containerfile index 2d4f279..bcd7c42 100644 --- a/src/tools/gen_initramfs/Containerfile +++ b/src/tools/gen_initramfs/Containerfile @@ -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 diff --git a/src/tools/sops/Containerfile b/src/tools/sops/Containerfile index d1ba635..9ed494b 100644 --- a/src/tools/sops/Containerfile +++ b/src/tools/sops/Containerfile @@ -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"] \ No newline at end of file +CMD ["--version"] diff --git a/src/tools/tofu/Containerfile b/src/tools/tofu/Containerfile index d2dfa26..ab4ff64 100644 --- a/src/tools/tofu/Containerfile +++ b/src/tools/tofu/Containerfile @@ -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"] \ No newline at end of file +CMD ["--version"]