stagex/packages/openssl/Containerfile
2024-02-15 07:22:38 -08:00

50 lines
1.1 KiB
Docker

FROM scratch as base
ENV VERSION=3.0.12
ENV SRC_HASH=f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61
ENV SRC_FILE=openssl-${VERSION}.tar.gz
ENV SRC_SITE=https://www.openssl.org/source/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
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 . /
RUN tar -xf ${SRC_FILE}
WORKDIR openssl-${VERSION}
ENV SOURCE_DATE_EPOCH=1
RUN --network=none <<-EOF
set -eux
export CC='gcc -fPIE -pie'
perl ./Configure \
--prefix=/usr \
--libdir=lib \
--openssldir=/etc/ssl \
threads \
enable-ktls \
shared \
no-zlib \
no-async \
no-comp \
no-idea \
no-mdc2 \
no-rc5 \
no-ec2m \
no-ssl3 \
no-seed \
no-weak-ssl-ciphers \
linux-x86_64
make
EOF
FROM build as install
RUN --network=none make DESTDIR=/rootfs install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /