stagex/packages/openssh/Containerfile

65 lines
1.9 KiB
Text
Raw Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
2024-08-06 00:10:52 +00:00
ENV VERSION=9.8p1
ENV SRC_HASH=dd8bd002a379b5d499dfb050dd1fa9af8029e80461f4bb6c523c49973f5a39f3
ENV SRC_FILE=openssh-${VERSION}.tar.gz
ENV SRC_SITE=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/${SRC_FILE}
2024-08-08 07:47:42 +00:00
FROM base AS fetch
2024-08-06 00:10:52 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
2024-08-06 00:10:52 +00:00
COPY --from=stagex/busybox . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/bison . /
COPY --from=stagex/libtool . /
COPY --from=stagex/zlib . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/flex . /
COPY --from=stagex/openssl . /
COPY --from=stagex/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/gettext . /
COPY --from=stagex/m4 . /
COPY --from=stagex/argp-standalone . /
COPY --from=stagex/musl . /
COPY --from=stagex/musl-fts . /
COPY --from=stagex/musl-obstack . /
COPY --from=stagex/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR openssh-${VERSION}
ADD *.patch .
RUN --network=none <<-EOF
set -eux
autoreconf -vif
./configure \
--build="x86_64-linux-musl" \
--host="x86_64-linux-musl" \
--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)"
EOF
2024-08-08 07:47:42 +00:00
FROM build AS install
2024-08-06 00:10:52 +00:00
RUN --network=none make DESTDIR=/rootfs install
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
2024-08-06 00:10:52 +00:00
COPY --from=install /rootfs/. /