Source
FROM stagex/pallet-gcc-gnu-busybox AS build
ARG VERSION
COPY --from=stagex/core-libzstd . /
COPY --from=stagex/core-openssl . /
ADD fetch/openssh-${VERSION}.tar.gz .
WORKDIR /openssh-${VERSION}
ADD *.patch .
RUN --network=none <<-EOF
set -eux
autoreconf -vif
./configure \
--prefix=/usr \
--sysconfdir=/etc/ssh \
--libexecdir=/usr/lib/ssh \
--mandir=/usr/share/man \
--with-cflags="$(pkg-config --cflags --static utmps)" \
--with-libs="$(pkg-config --libs --static utmps)" \
--with-privsep-path=/var/empty \
--with-pid-dir=/run \
--with-mantype=doc \
--with-xauth=/usr/bin/xauth \
--with-default-path='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \
--disable-utmp \
--disable-wtmp \
--disable-lastlog \
--disable-strip \
--with-ssl-engine
make -j "$(nproc)"
make DESTDIR=/rootfs install
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /