remove custom image overrides from each Dockerfile, favoring build contexts

This commit is contained in:
Lance Vick 2024-02-05 02:36:12 -08:00
parent cf04bfc6e6
commit 6c9088c55c
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
34 changed files with 205 additions and 444 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

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

@ -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

@ -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

@ -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,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" "{}" +

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

@ -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

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,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

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,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

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,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

@ -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"]