stagex/packages/openssl/Containerfile

51 lines
1.1 KiB
Text
Raw Normal View History

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