FROM scratch AS base ENV VERSION=1.8.0.0 ENV SRC_HASH=6010f4f311e5ebe0e63c77f78613d264253680006ac8979f52b0711a9a231e82 ENV SRC_FILE=socat-${VERSION}.tar.gz ENV SRC_SITE=http://www.dest-unreach.org/socat/download/${SRC_FILE} FROM base AS fetch ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE} FROM fetch AS build COPY --from=stagex/busybox . / COPY --from=stagex/musl . / COPY --from=stagex/gcc . / COPY --from=stagex/binutils . / COPY --from=stagex/make . / RUN tar -xvf $SRC_FILE WORKDIR /socat-${VERSION} ENV SOURCE_DATE_EPOCH=1 RUN --network=none <<-EOF set -eux ./configure \ --build=x86_64-unknown-linux-musl \ --host=x86_64-unknown-linux-musl \ --prefix=/usr/ make -j "$(nproc)" EOF FROM build AS install RUN --network=none make DESTDIR=/rootfs install FROM stagex/filesystem AS package COPY --from=install /rootfs/. /