FROM scratch AS base ENV VERSION=1.1.13 ENV COMMIT=58aa9203c123022138b22cf96540c284876a7910 ENV SRC_FILE=runc-v${VERSION}.tar.gz ENV SRC_SITE=https://github.com/opencontainers/runc/archive/v${VERSION}/${SRC_FILE} ENV SRC_HASH=789d5749a08ef1fbe5d1999b67883206a68a4e58e6ca0151c411d678f3480b25 FROM base AS fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} . FROM fetch AS build COPY --from=stagex/musl . / COPY --from=stagex/bash . / COPY --from=stagex/busybox . / COPY --from=stagex/go . / COPY --from=stagex/go-md2man . / COPY --from=stagex/make . / COPY --from=stagex/gcc . / COPY --from=stagex/binutils . / COPY --from=stagex/linux-headers . / COPY --from=stagex/pkgconf . / COPY --from=stagex/libseccomp . / RUN tar -xf ${SRC_FILE} WORKDIR /runc-${VERSION} RUN <<-EOF set -eux make EXTRA_LDFLAGS="-w -s -buildid=" COMMIT=${COMMIT} -j "$(nproc)" make man EOF FROM build AS install RUN <<-EOF set -eux install -Dsm755 runc /rootfs/usr/bin/runc install -d /rootfs/usr/share/man/man8 install -Dm644 man/man8/* /rootfs/usr/share/man/man8/ EOF FROM stagex/filesystem AS package COPY --from=install /rootfs/. /