-
Notifications
You must be signed in to change notification settings - Fork 123
/
openssl.dockerfile
38 lines (36 loc) · 973 Bytes
/
openssl.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ARG BASE_IMAGE=debian:bookworm-slim
FROM ${BASE_IMAGE}
ARG SSL_VERSION=3.2.1
ENV SRC_DIR=/tmp/openssl-src
ENV OUT_DIR=/usr/local/.openssl
RUN chmod 1777 /tmp
RUN <<`
set -e
apt-get update
apt-get install -y curl build-essential libssl-dev libz-dev
apt-get remove -y openssl
apt-get clean
`
WORKDIR ${SRC_DIR}
RUN <<`
set -ex
curl --silent -LO https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz
tar -xf openssl-${SSL_VERSION}.tar.gz --strip-components=1
`
RUN ./config --prefix=${OUT_DIR} --openssldir=${OUT_DIR} shared zlib
RUN <<`
set -e
make
make test
make install
`
RUN <<`
set -e
echo "${OUT_DIR}/lib" > /etc/ld.so.conf.d/openssl-${SSL_VERSION}.conf
ldconfig
ln -sf ${OUT_DIR}/bin/openssl /usr/bin/openssl
ln -sf ${OUT_DIR}/lib64/libssl.so.3 /lib/x86_64-linux-gnu/libssl.so.3
ln -sf ${OUT_DIR}/lib64/libcrypto.so.3 /lib/x86_64-linux-gnu/libcrypto.so.3
`
WORKDIR /
RUN rm -rf ${SRC_DIR}