From 2a3a3e55b4012259ebf1e3872bdd7ddc443cfd70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20B=C3=A4umer?= Date: Mon, 19 Oct 2026 23:11:31 +0200 Subject: [PATCH] build: Optimize Dockerfiles --- .../resources/images/baseimage/Dockerfile | 3 +-- .../images/baseimage/Dockerfile_debian | 3 ++- .../images/baseimage/Dockerfile_entrypoint | 6 ++--- .../resources/images/basicClient/Dockerfile | 4 +++- .../images/boringssl/Dockerfile-2214-2661 | 11 ++++----- .../images/boringssl/Dockerfile-2272-2357 | 11 ++++----- .../images/boringssl/Dockerfile-2704-3945 | 6 ++--- .../boringssl/Dockerfile-945f4a5_x509_anvil | 14 ++++++----- .../resources/images/boringssl/Dockerfile-x | 6 ++--- .../images/botan/Dockerfile-1_11_25-29 | 11 +++++---- .../resources/images/botan/Dockerfile-1_11_34 | 7 +++--- .../images/botan/Dockerfile-1_11_9-13 | 11 +++++---- .../resources/images/botan/Dockerfile-1_11_x | 11 +++++---- .../resources/images/botan/Dockerfile-2_0-10 | 7 +++--- .../resources/images/botan/Dockerfile-2_11-x | 9 +++---- .../images/botan/Dockerfile-3_9_0_x509_anvil | 14 +++++------ src/main/resources/images/botan/Dockerfile-3x | 10 ++++---- .../images/bouncycastle/Dockerfile-1_x | 6 +++-- src/main/resources/images/firefox/Dockerfile | 22 ++++++++--------- .../images/gnutls/Dockerfile-3_3_0-15 | 24 +++++++++---------- .../resources/images/gnutls/Dockerfile-3_3_x | 24 +++++++++---------- .../resources/images/gnutls/Dockerfile-3_4_x | 24 +++++++++---------- .../images/gnutls/Dockerfile-3_5_0-7 | 24 +++++++++---------- .../images/gnutls/Dockerfile-3_5_8-16 | 24 +++++++++---------- .../images/gnutls/Dockerfile-3_6_0-2 | 12 +++++----- .../images/gnutls/Dockerfile-3_6_3-x | 23 +++++++++--------- .../images/gnutls/Dockerfile-3_7_0-x | 19 +++++++-------- .../images/gnutls/Dockerfile-3_8_0-x | 13 +++++----- src/main/resources/images/go/Dockerfile | 4 ++-- src/main/resources/images/jsse/Dockerfile | 6 +++-- .../resources/images/libressl/Dockerfile-2_x | 16 ++++++------- .../matrixssl/Dockerfile-3_7_2_and_3_4_0 | 5 ++-- .../resources/images/matrixssl/Dockerfile-3_x | 16 +++++++------ .../resources/images/matrixssl/Dockerfile-4_x | 11 +++++---- .../images/mbedtls/Dockerfile-mbedtls_x | 9 +++---- .../images/mbedtls/Dockerfile-mbedtls_x2 | 14 ++++++----- .../mbedtls/Dockerfile-polarssl_under_1.2 | 9 +++---- .../images/mbedtls/Dockerfile-polarssl_x | 9 +++---- src/main/resources/images/nss/Dockerfile | 22 ++++++++--------- .../images/nss/Dockerfile_pre_3_36_8 | 12 ++++------ src/main/resources/images/ocamltls/Dockerfile | 18 +++++++------- .../images/openhitls/Dockerfile-0_2_x | 18 +++++++------- .../images/openssl/Dockerfile-0_9_6x | 21 ++++++++-------- .../images/openssl/Dockerfile-0_9_7x | 17 ++++++------- .../images/openssl/Dockerfile-0_9_8a-n | 17 ++++++------- .../images/openssl/Dockerfile-0_9_8m-zh | 17 ++++++------- .../images/openssl/Dockerfile-0_9_8zh | 14 ++++++----- .../images/openssl/Dockerfile-1_0_0beta1-4 | 18 +++++++------- .../images/openssl/Dockerfile-1_0_0x | 20 ++++++++-------- .../images/openssl/Dockerfile-1_0_1m-u | 15 ++++++------ .../images/openssl/Dockerfile-1_0_1x | 18 +++++++------- .../resources/images/openssl/Dockerfile-1_0_2 | 16 +++++++------ .../images/openssl/Dockerfile-1_0_2_and_betas | 19 ++++++++------- .../images/openssl/Dockerfile-1_0_2l | 14 ++++++----- .../images/openssl/Dockerfile-1_0_2x | 15 ++++++------ .../images/openssl/Dockerfile-1_1_0-pre1and2 | 16 +++++++------ .../images/openssl/Dockerfile-1_1_0f | 14 ++++++----- .../images/openssl/Dockerfile-1_1_0x | 16 +++++++------ .../images/openssl/Dockerfile-1_1_1x | 16 +++++++------ .../resources/images/openssl/Dockerfile-3_x | 22 ++++++++--------- .../resources/images/openssl/Dockerfile-4_x | 19 +++++++-------- .../resources/images/pyopenssl/Dockerfile | 3 +-- .../resources/images/python-gnutls/Dockerfile | 7 +++--- .../images/python-mbedtls/Dockerfile | 11 ++++----- .../images/python-mbedtls/Dockerfile_old | 7 +++--- src/main/resources/images/rustls/Dockerfile | 1 - .../images/rustls/Dockerfile-23_34_x509_anvil | 3 +-- .../images/rustls/Dockerfile_12_0-15_1 | 3 +-- .../images/rustls/Dockerfile_15_2-16_0 | 3 +-- .../images/rustls/Dockerfile_17-19_0 | 3 +-- .../resources/images/rustls/Dockerfile_23_x | 3 +-- src/main/resources/images/s2n/Dockerfile | 4 +++- .../images/tlslite_ng/Dockerfile_python2 | 2 +- .../images/tlslite_ng/Dockerfile_python3 | 14 +++++------ .../resources/images/wolfssl/Dockerfile-2_x | 21 ++++++++-------- .../resources/images/wolfssl/Dockerfile-3_0-2 | 21 ++++++++-------- .../resources/images/wolfssl/Dockerfile-3_3-x | 21 ++++++++-------- .../images/wolfssl/Dockerfile-4_and_5_x | 21 ++++++++-------- .../resources/images/wolfssl/Dockerfile-5_x | 21 ++++++++-------- .../resources/images/wolfssl_py/Dockerfile | 12 +++++----- .../images/wolfssl_py/Dockerfile_old | 7 +++--- 81 files changed, 523 insertions(+), 517 deletions(-) diff --git a/src/main/resources/images/baseimage/Dockerfile b/src/main/resources/images/baseimage/Dockerfile index d7311b8..14ce367 100644 --- a/src/main/resources/images/baseimage/Dockerfile +++ b/src/main/resources/images/baseimage/Dockerfile @@ -1,7 +1,6 @@ ARG VERSION=latest FROM alpine:$VERSION -RUN apk update &&\ - apk add git \ +RUN apk add --no-cache git \ mercurial \ alpine-sdk \ gettext-dev \ diff --git a/src/main/resources/images/baseimage/Dockerfile_debian b/src/main/resources/images/baseimage/Dockerfile_debian index 5dd82fc..afa0582 100644 --- a/src/main/resources/images/baseimage/Dockerfile_debian +++ b/src/main/resources/images/baseimage/Dockerfile_debian @@ -20,7 +20,8 @@ RUN apt-get update &&\ rsync \ bash \ coreutils \ - build-essential + build-essential && \ + rm -rf /var/lib/apt/lists/* COPY ./ca.pem /etc/ssl/certs/ WORKDIR /src/ diff --git a/src/main/resources/images/baseimage/Dockerfile_entrypoint b/src/main/resources/images/baseimage/Dockerfile_entrypoint index a3b2f1e..363e6f7 100644 --- a/src/main/resources/images/baseimage/Dockerfile_entrypoint +++ b/src/main/resources/images/baseimage/Dockerfile_entrypoint @@ -1,9 +1,9 @@ FROM golang:1.14 AS build COPY entrypoints /build/ WORKDIR /build -RUN CGO_ENABLED=0 GOOS=linux go build -o ./ ./... +# -s -w strips the symbol table and DWARF debug info from the binaries +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o ./ ./... FROM scratch -COPY --from=build /build/client-entrypoint /bin/ -COPY --from=build /build/server-entrypoint /bin/ +COPY --from=build /build/client-entrypoint /build/server-entrypoint /bin/ diff --git a/src/main/resources/images/basicClient/Dockerfile b/src/main/resources/images/basicClient/Dockerfile index ce5d2b2..d8a4c4b 100644 --- a/src/main/resources/images/basicClient/Dockerfile +++ b/src/main/resources/images/basicClient/Dockerfile @@ -1,6 +1,8 @@ FROM debian:latest -RUN apt-get update && apt-get install -y openssl tcpdump +RUN apt-get update && \ + apt-get install -y openssl tcpdump && \ + rm -rf /var/lib/apt/lists/* COPY entrypoint.sh /entrypoint/ WORKDIR /output/ diff --git a/src/main/resources/images/boringssl/Dockerfile-2214-2661 b/src/main/resources/images/boringssl/Dockerfile-2214-2661 index 316108a..37e0335 100644 --- a/src/main/resources/images/boringssl/Dockerfile-2214-2661 +++ b/src/main/resources/images/boringssl/Dockerfile-2214-2661 @@ -3,14 +3,13 @@ ARG VERSION RUN git clone --depth=1 -b ${VERSION} https://github.com/google/boringssl.git #remove the errorflags in CMakeLists.txt otherwise boringssl will not compile (workaround) #/src/boringssl/crypto/pem/pem_lib.c:460:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] -RUN sed -i -e 's/-Wall -Werror //g' /src/boringssl/CMakeLists.txt -RUN sed -i -e 's/-Wall -Wshadow -Werror //g' /src/boringssl/CMakeLists.txt +RUN sed -i -e 's/-Wall -Werror //g' -e 's/-Wall -Wshadow -Werror //g' /src/boringssl/CMakeLists.txt WORKDIR /build/ -RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 /src/boringssl/ -RUN make +RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 /src/boringssl/ &&\ + make -j"$(nproc)" # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/tool/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/tool/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as boringssl-base2 COPY --from=boringssl-base1 /src/boringssl/include/ /artifacts/ssllib/include/ diff --git a/src/main/resources/images/boringssl/Dockerfile-2272-2357 b/src/main/resources/images/boringssl/Dockerfile-2272-2357 index dd7d0fe..16eff88 100644 --- a/src/main/resources/images/boringssl/Dockerfile-2272-2357 +++ b/src/main/resources/images/boringssl/Dockerfile-2272-2357 @@ -3,15 +3,14 @@ ARG VERSION RUN git clone --depth=1 -b ${VERSION} https://github.com/google/boringssl.git #remove the errorflags in CMakeLists.txt otherwise boringssl will not compile (workaround) #/src/boringssl/crypto/pem/pem_lib.c:460:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] -RUN sed -i -e 's/-Wall -Wshadow -Werror //g' /src/boringssl/CMakeLists.txt -RUN sed -i -e 's/-Wall -Werror //g' /src/boringssl/CMakeLists.txt +RUN sed -i -e 's/-Wall -Wshadow -Werror //g' -e 's/-Wall -Werror //g' /src/boringssl/CMakeLists.txt WORKDIR /build/ -RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 /src/boringssl/ #ignore the errors while compiling, linker errors in the shim module -> shim is not working -RUN make -i +RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 /src/boringssl/ &&\ + make -i -j"$(nproc)" # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/tool/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/tool/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as boringssl-base2 COPY --from=boringssl-base1 /src/boringssl/include/ /artifacts/ssllib/include/ diff --git a/src/main/resources/images/boringssl/Dockerfile-2704-3945 b/src/main/resources/images/boringssl/Dockerfile-2704-3945 index 2619fb4..0528b3f 100644 --- a/src/main/resources/images/boringssl/Dockerfile-2704-3945 +++ b/src/main/resources/images/boringssl/Dockerfile-2704-3945 @@ -3,10 +3,10 @@ ARG VERSION RUN git clone --depth=1 -b ${VERSION} https://github.com/google/boringssl.git WORKDIR /build/ RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 /src/boringssl/ &&\ - make + make -j"$(nproc)" # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/tool/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/tool/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as boringssl-base2 diff --git a/src/main/resources/images/boringssl/Dockerfile-945f4a5_x509_anvil b/src/main/resources/images/boringssl/Dockerfile-945f4a5_x509_anvil index c55b74a..3172265 100644 --- a/src/main/resources/images/boringssl/Dockerfile-945f4a5_x509_anvil +++ b/src/main/resources/images/boringssl/Dockerfile-945f4a5_x509_anvil @@ -1,16 +1,18 @@ FROM alpine-build:3.19 AS boringssl-base1 WORKDIR /src/ COPY x509_bssl.patch /src/x509_bssl.patch -RUN git clone https://github.com/google/boringssl.git WORKDIR /src/boringssl/ -RUN git checkout 945f4a5d8fd6abf0c7471242151c727e02e889a2 -RUN git apply /src/x509_bssl.patch +RUN git init && \ + git remote add origin https://github.com/google/boringssl.git && \ + git fetch --depth 1 origin 945f4a5d8fd6abf0c7471242151c727e02e889a2 && \ + git checkout FETCH_HEAD && \ + git apply /src/x509_bssl.patch WORKDIR /build/ RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 /src/boringssl/ &&\ - make + make -j"$(nproc)" # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint AS boringssl-base2 diff --git a/src/main/resources/images/boringssl/Dockerfile-x b/src/main/resources/images/boringssl/Dockerfile-x index a10689c..7a53e52 100644 --- a/src/main/resources/images/boringssl/Dockerfile-x +++ b/src/main/resources/images/boringssl/Dockerfile-x @@ -3,10 +3,10 @@ ARG VERSION RUN git clone --depth=1 -b ${VERSION} https://github.com/google/boringssl.git WORKDIR /build/ RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 /src/boringssl/ &&\ - make + make -j"$(nproc)" # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as boringssl-base2 diff --git a/src/main/resources/images/botan/Dockerfile-1_11_25-29 b/src/main/resources/images/botan/Dockerfile-1_11_25-29 index 00500ae..7c109dc 100644 --- a/src/main/resources/images/botan/Dockerfile-1_11_25-29 +++ b/src/main/resources/images/botan/Dockerfile-1_11_25-29 @@ -1,12 +1,13 @@ FROM alpine-build:3.6 as botan-base1 ARG VERSION -RUN apk add boost-dev -RUN wget -O botan.tar.gz https://botan.randombit.net/releases/old/Botan-1.11.${VERSION}.tgz -RUN mkdir botan -RUN tar -xzf botan.tar.gz -C botan --strip-components 1 +RUN apk add --no-cache boost-dev +RUN wget -O botan.tar.gz https://botan.randombit.net/releases/old/Botan-1.11.${VERSION}.tgz && \ + mkdir botan && \ + tar -xzf botan.tar.gz -C botan --strip-components 1 && \ + rm botan.tar.gz WORKDIR botan RUN ./configure.py --prefix=/build/ &&\ - make -i &&\ + make -i -j"$(nproc)" &&\ make install RUN mv /build/lib/libbotan-1.11.so.${VERSION}.${VERSION} /build/lib/libbotan-1.11.so.${VERSION} diff --git a/src/main/resources/images/botan/Dockerfile-1_11_34 b/src/main/resources/images/botan/Dockerfile-1_11_34 index 48d6579..0a4fa20 100644 --- a/src/main/resources/images/botan/Dockerfile-1_11_34 +++ b/src/main/resources/images/botan/Dockerfile-1_11_34 @@ -1,9 +1,10 @@ FROM alpine-build:3.6 as botan-base1 -RUN wget https://botan.randombit.net/releases/old/Botan-1.11.34.tgz -RUN tar -xzf Botan-1.11.34.tgz +RUN wget https://botan.randombit.net/releases/old/Botan-1.11.34.tgz && \ + tar -xzf Botan-1.11.34.tgz && \ + rm Botan-1.11.34.tgz WORKDIR Botan-1.11.34 RUN ./configure.py --prefix=/build/ &&\ - make &&\ + make -j"$(nproc)" &&\ make install RUN mv /build/lib/libbotan-1.11.so.34.34 /build/lib/libbotan-1.11.so.34 diff --git a/src/main/resources/images/botan/Dockerfile-1_11_9-13 b/src/main/resources/images/botan/Dockerfile-1_11_9-13 index 13b4882..c4bf562 100644 --- a/src/main/resources/images/botan/Dockerfile-1_11_9-13 +++ b/src/main/resources/images/botan/Dockerfile-1_11_9-13 @@ -1,12 +1,13 @@ FROM alpine-build:3.6 as botan-base1 ARG VERSION -RUN apk add boost-dev -RUN wget -O botan.tar.gz https://botan.randombit.net/releases/old/Botan-1.11.${VERSION}.tgz -RUN mkdir botan -RUN tar -xzf botan.tar.gz -C botan --strip-components 1 +RUN apk add --no-cache boost-dev +RUN wget -O botan.tar.gz https://botan.randombit.net/releases/old/Botan-1.11.${VERSION}.tgz && \ + mkdir botan && \ + tar -xzf botan.tar.gz -C botan --strip-components 1 && \ + rm botan.tar.gz WORKDIR botan RUN ./configure.py --prefix=/build/ &&\ - make -s &&\ + make -s -j"$(nproc)" &&\ make install -s RUN mv /build/lib/libbotan-1.11.so.${VERSION}.${VERSION} /build/lib/libbotan-1.11.so.${VERSION} diff --git a/src/main/resources/images/botan/Dockerfile-1_11_x b/src/main/resources/images/botan/Dockerfile-1_11_x index 7bd4797..e42a5f2 100644 --- a/src/main/resources/images/botan/Dockerfile-1_11_x +++ b/src/main/resources/images/botan/Dockerfile-1_11_x @@ -1,12 +1,13 @@ FROM alpine-build:3.6 as botan-base1 ARG VERSION -RUN apk add boost-dev -RUN wget -O botan.tar.gz https://botan.randombit.net/releases/old/Botan-1.11.${VERSION}.tgz -RUN mkdir botan -RUN tar -xzf botan.tar.gz -C botan --strip-components 1 +RUN apk add --no-cache boost-dev +RUN wget -O botan.tar.gz https://botan.randombit.net/releases/old/Botan-1.11.${VERSION}.tgz && \ + mkdir botan && \ + tar -xzf botan.tar.gz -C botan --strip-components 1 && \ + rm botan.tar.gz WORKDIR botan RUN ./configure.py --prefix=/build/ &&\ - make -s &&\ + make -s -j"$(nproc)" &&\ make install -s RUN mv /build/lib/libbotan-1.11.so.${VERSION}.${VERSION} /build/lib/libbotan-1.11.so.${VERSION} diff --git a/src/main/resources/images/botan/Dockerfile-2_0-10 b/src/main/resources/images/botan/Dockerfile-2_0-10 index 38dacf7..14b9cb4 100644 --- a/src/main/resources/images/botan/Dockerfile-2_0-10 +++ b/src/main/resources/images/botan/Dockerfile-2_0-10 @@ -1,10 +1,11 @@ FROM alpine-build:3.6 as botan-base1 ARG VERSION -RUN wget https://botan.randombit.net/releases/Botan-2.${VERSION}.tgz -RUN tar -xzf Botan-2.${VERSION}.tgz +RUN wget https://botan.randombit.net/releases/Botan-2.${VERSION}.tgz && \ + tar -xzf Botan-2.${VERSION}.tgz && \ + rm Botan-2.${VERSION}.tgz WORKDIR Botan-2.${VERSION} RUN ./configure.py --prefix=/build/ &&\ - make &&\ + make -j"$(nproc)" &&\ make install FROM entrypoint as botan-base2 diff --git a/src/main/resources/images/botan/Dockerfile-2_11-x b/src/main/resources/images/botan/Dockerfile-2_11-x index 4d2274c..c73d8e7 100644 --- a/src/main/resources/images/botan/Dockerfile-2_11-x +++ b/src/main/resources/images/botan/Dockerfile-2_11-x @@ -1,11 +1,12 @@ FROM alpine-build:3.12 as botan-base1 ARG VERSION -RUN wget https://botan.randombit.net/releases/Botan-2.${VERSION}.tar.xz -RUN tar -xf Botan-2.${VERSION}.tar.xz +RUN apk add --no-cache python2 && \ + wget https://botan.randombit.net/releases/Botan-2.${VERSION}.tar.xz && \ + tar -xf Botan-2.${VERSION}.tar.xz && \ + rm Botan-2.${VERSION}.tar.xz WORKDIR Botan-2.${VERSION} -RUN apk add python2 RUN ./configure.py --prefix=/build/ &&\ - make &&\ + make -j"$(nproc)" &&\ make install FROM entrypoint as botan-base2 diff --git a/src/main/resources/images/botan/Dockerfile-3_9_0_x509_anvil b/src/main/resources/images/botan/Dockerfile-3_9_0_x509_anvil index b6696e1..5abb4e9 100644 --- a/src/main/resources/images/botan/Dockerfile-3_9_0_x509_anvil +++ b/src/main/resources/images/botan/Dockerfile-3_9_0_x509_anvil @@ -1,14 +1,14 @@ FROM alpine-build:3.17 AS botan-base1 -RUN wget https://botan.randombit.net/releases/Botan-3.9.0.tar.xz -RUN apk add xz -RUN tar -xf Botan-3.9.0.tar.xz +RUN apk add --no-cache xz python3 && \ + wget https://botan.randombit.net/releases/Botan-3.9.0.tar.xz && \ + tar -xf Botan-3.9.0.tar.xz && \ + rm Botan-3.9.0.tar.xz WORKDIR Botan-3.9.0 COPY botan_3.9.0_clientauth.patch botan_3.9.0_clientauth.patch -RUN git apply botan_3.9.0_clientauth.patch -RUN apk add python3 -RUN ./configure.py --prefix=/build/ &&\ - make &&\ +RUN git apply botan_3.9.0_clientauth.patch && \ + ./configure.py --prefix=/build/ &&\ + make -j"$(nproc)" &&\ make install FROM entrypoint AS botan-base2 diff --git a/src/main/resources/images/botan/Dockerfile-3x b/src/main/resources/images/botan/Dockerfile-3x index 8cfbc6d..ef0f2af 100644 --- a/src/main/resources/images/botan/Dockerfile-3x +++ b/src/main/resources/images/botan/Dockerfile-3x @@ -1,13 +1,13 @@ FROM alpine-build:3.17 as botan-base1 ARG VERSION ARG BUILD_FLAGS="" -RUN wget https://botan.randombit.net/releases/Botan-3.${VERSION}.tar.xz -RUN apk add xz -RUN tar -xf Botan-3.${VERSION}.tar.xz +RUN apk add --no-cache xz python3 && \ + wget https://botan.randombit.net/releases/Botan-3.${VERSION}.tar.xz && \ + tar -xf Botan-3.${VERSION}.tar.xz && \ + rm Botan-3.${VERSION}.tar.xz WORKDIR Botan-3.${VERSION} -RUN apk add python3 RUN ./configure.py --prefix=/build/ ${BUILD_FLAGS} &&\ - make &&\ + make -j"$(nproc)" &&\ make install FROM entrypoint as botan-base2 diff --git a/src/main/resources/images/bouncycastle/Dockerfile-1_x b/src/main/resources/images/bouncycastle/Dockerfile-1_x index 679f9bf..e6a3552 100644 --- a/src/main/resources/images/bouncycastle/Dockerfile-1_x +++ b/src/main/resources/images/bouncycastle/Dockerfile-1_x @@ -1,8 +1,10 @@ FROM maven:slim as maven ARG VERSION -RUN apt update && apt install -y git +RUN apt-get update && \ + apt-get install -y git && \ + rm -rf /var/lib/apt/lists/* WORKDIR /src -RUN git clone https://github.com/RUB-NDS/BouncyCastleTLS.git +RUN git clone --depth=1 https://github.com/RUB-NDS/BouncyCastleTLS.git WORKDIR /src/BouncyCastleTLS RUN mvn clean install -Dbc.version=1.${VERSION} diff --git a/src/main/resources/images/firefox/Dockerfile b/src/main/resources/images/firefox/Dockerfile index b42a8c2..b9cc023 100644 --- a/src/main/resources/images/firefox/Dockerfile +++ b/src/main/resources/images/firefox/Dockerfile @@ -1,19 +1,19 @@ FROM ubuntu:16.04 as firefox-ubuntu-base -RUN apt-get update -RUN apt-get install -y wget -RUN apt-get install -y bzip2 -RUN apt-get install -y --no-install-recommends xfce4 -RUN apt-get install -y --no-install-recommends libcanberra-gtk* +RUN apt-get update && \ + apt-get install -y wget bzip2 && \ + apt-get install -y --no-install-recommends xfce4 && \ + apt-get install -y --no-install-recommends libcanberra-gtk* && \ + rm -rf /var/lib/apt/lists/* FROM firefox-ubuntu-base as firefox-client ARG VERSION -RUN wget https://ftp.mozilla.org/pub/firefox/releases/${VERSION}/linux-$(uname -m)/en-US/firefox-${VERSION}.tar.bz2 -RUN tar -xjf firefox-${VERSION}.tar.bz2 -RUN mv firefox /opt/ -COPY ./autoconfig.js /opt/firefox/defaults/pref/ -COPY ./ca.pem /opt/firefox/defaults/pref/ +# download, extract and delete the archive in one layer to keep it out of the image +RUN wget https://ftp.mozilla.org/pub/firefox/releases/${VERSION}/linux-$(uname -m)/en-US/firefox-${VERSION}.tar.bz2 && \ + tar -xjf firefox-${VERSION}.tar.bz2 -C /opt/ && \ + rm firefox-${VERSION}.tar.bz2 && \ + ln -sf /opt/firefox/firefox /bin/firefox +COPY ./autoconfig.js ./ca.pem /opt/firefox/defaults/pref/ COPY ./mozilla.cfg /opt/firefox/ -RUN ln -sf /opt/firefox/firefox /bin/firefox LABEL "tls_implementation"="firefox" LABEL "tls_implementation_version"="${VERSION}" LABEL "tls_implementation_connectionRole"="client" diff --git a/src/main/resources/images/gnutls/Dockerfile-3_3_0-15 b/src/main/resources/images/gnutls/Dockerfile-3_3_0-15 index 4a86b0e..625d94c 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_3_0-15 +++ b/src/main/resources/images/gnutls/Dockerfile-3_3_0-15 @@ -8,24 +8,22 @@ FROM alpine-build:3.6 as gnutls-gnutls ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ RUN git clone --depth=1 --branch gnutls_3_3_${VERSION} https://github.com/gnutls/gnutls -RUN apk add guile -RUN apk add guile-dev -RUN wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz -RUN tar -xzf autogen-5.18.12.tar.gz +RUN apk add --no-cache guile guile-dev && \ + wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz && \ + tar -xzf autogen-5.18.12.tar.gz && \ + rm autogen-5.18.12.tar.gz WORKDIR /src/autogen-5.18.12/ -RUN ./configure -RUN make -RUN make install +RUN ./configure && make && make install WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN make autoreconf && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_3_x b/src/main/resources/images/gnutls/Dockerfile-3_3_x index 9a56395..cedb864 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_3_x +++ b/src/main/resources/images/gnutls/Dockerfile-3_3_x @@ -8,24 +8,22 @@ FROM alpine-build:3.6 as gnutls-gnutls ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ RUN git clone --depth=1 --branch gnutls_3_3_${VERSION} https://github.com/gnutls/gnutls -RUN apk add guile -RUN apk add guile-dev -RUN wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz -RUN tar -xzf autogen-5.18.12.tar.gz +RUN apk add --no-cache guile guile-dev && \ + wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz && \ + tar -xzf autogen-5.18.12.tar.gz && \ + rm autogen-5.18.12.tar.gz WORKDIR /src/autogen-5.18.12/ -RUN ./configure -RUN make -RUN make install +RUN ./configure && make && make install WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN make autoreconf && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_4_x b/src/main/resources/images/gnutls/Dockerfile-3_4_x index f6ab74e..bd4d514 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_4_x +++ b/src/main/resources/images/gnutls/Dockerfile-3_4_x @@ -8,24 +8,22 @@ FROM alpine-build:3.6 as gnutls-gnutls ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ RUN git clone --depth=1 --branch gnutls_3_4_${VERSION} https://github.com/gnutls/gnutls -RUN apk add guile -RUN apk add guile-dev -RUN wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz -RUN tar -xzf autogen-5.18.12.tar.gz +RUN apk add --no-cache guile guile-dev && \ + wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz && \ + tar -xzf autogen-5.18.12.tar.gz && \ + rm autogen-5.18.12.tar.gz WORKDIR /src/autogen-5.18.12/ -RUN ./configure -RUN make -RUN make install +RUN ./configure && make && make install WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN make autoreconf && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_5_0-7 b/src/main/resources/images/gnutls/Dockerfile-3_5_0-7 index 217239c..63cb089 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_5_0-7 +++ b/src/main/resources/images/gnutls/Dockerfile-3_5_0-7 @@ -8,24 +8,22 @@ FROM alpine-build:3.6 as gnutls-gnutls ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ RUN git clone --depth=1 --branch gnutls_3_5_${VERSION} https://github.com/gnutls/gnutls -RUN apk add guile -RUN apk add guile-dev -RUN wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz -RUN tar -xzf autogen-5.18.12.tar.gz +RUN apk add --no-cache guile guile-dev && \ + wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz && \ + tar -xzf autogen-5.18.12.tar.gz && \ + rm autogen-5.18.12.tar.gz WORKDIR /src/autogen-5.18.12/ -RUN ./configure -RUN make -RUN make install +RUN ./configure && make && make install WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN make autoreconf && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_5_8-16 b/src/main/resources/images/gnutls/Dockerfile-3_5_8-16 index bd02a88..9b5e2c9 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_5_8-16 +++ b/src/main/resources/images/gnutls/Dockerfile-3_5_8-16 @@ -8,24 +8,22 @@ FROM alpine-build:3.6 as gnutls-gnutls ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ RUN git clone --depth=1 --branch gnutls_3_5_${VERSION} https://github.com/gnutls/gnutls -RUN apk add guile -RUN apk add guile-dev -RUN wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz -RUN tar -xzf autogen-5.18.12.tar.gz +RUN apk add --no-cache guile guile-dev && \ + wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz && \ + tar -xzf autogen-5.18.12.tar.gz && \ + rm autogen-5.18.12.tar.gz WORKDIR /src/autogen-5.18.12/ -RUN ./configure -RUN make -RUN make install +RUN ./configure && make && make install WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN make autoreconf && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_6_0-2 b/src/main/resources/images/gnutls/Dockerfile-3_6_0-2 index 5ecffc1..05be2be 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_6_0-2 +++ b/src/main/resources/images/gnutls/Dockerfile-3_6_0-2 @@ -11,13 +11,13 @@ RUN git clone --depth=1 --branch gnutls_3_6_${VERSION} https://github.com/gnutls WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN make autoreconf && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_6_3-x b/src/main/resources/images/gnutls/Dockerfile-3_6_3-x index ecc9fa9..c3d66a6 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_6_3-x +++ b/src/main/resources/images/gnutls/Dockerfile-3_6_3-x @@ -9,23 +9,22 @@ ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ # after 3.6.12 the tag format changed RUN git clone --depth=1 --branch gnutls_3_6_${VERSION} https://github.com/gnutls/gnutls || git clone --depth=1 --branch 3.6.${VERSION} https://github.com/gnutls/gnutls -RUN apk add guile -RUN apk add guile-dev -RUN wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz -RUN tar -xzf autogen-5.18.12.tar.gz +RUN apk add --no-cache guile guile-dev && \ + wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz && \ + tar -xzf autogen-5.18.12.tar.gz && \ + rm autogen-5.18.12.tar.gz WORKDIR /src/autogen-5.18.12/ -RUN ./configure -RUN make && make install +RUN ./configure && make && make install WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf || ./bootstrap -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN (make autoreconf || ./bootstrap) && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-serv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/gnutls-cli | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_7_0-x b/src/main/resources/images/gnutls/Dockerfile-3_7_0-x index 113dfc1..9da871b 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_7_0-x +++ b/src/main/resources/images/gnutls/Dockerfile-3_7_0-x @@ -9,21 +9,18 @@ ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ # after 3.6.12 the tag format changed RUN git clone --depth=1 --branch gnutls_3_7_${VERSION} https://github.com/gnutls/gnutls || git clone --depth=1 --branch 3.7.${VERSION} https://github.com/gnutls/gnutls -RUN apk add gtk-doc -RUN apk add guile -RUN apk add guile-dev -RUN apk add libtasn1-progs -RUN wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz -RUN tar -xzf autogen-5.18.12.tar.gz +RUN apk add --no-cache gtk-doc guile guile-dev libtasn1-progs && \ + wget https://ftp.gnu.org/gnu/autogen/rel5.18.12/autogen-5.18.12.tar.gz && \ + tar -xzf autogen-5.18.12.tar.gz && \ + rm autogen-5.18.12.tar.gz WORKDIR /src/autogen-5.18.12/ -RUN ./configure -RUN make && make install +RUN ./configure && make && make install WORKDIR /src/gnutls/ RUN git submodule update --init --no-fetch COPY --from=gnutls-libnettle /build/ /build/ -RUN make autoreconf || ./bootstrap -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN (make autoreconf || ./bootstrap) && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install FROM entrypoint as gnutls-base COPY --from=gnutls-gnutls /lib/ld-musl-x86_64.so.* \ diff --git a/src/main/resources/images/gnutls/Dockerfile-3_8_0-x b/src/main/resources/images/gnutls/Dockerfile-3_8_0-x index 94d6e7d..735a0a3 100644 --- a/src/main/resources/images/gnutls/Dockerfile-3_8_0-x +++ b/src/main/resources/images/gnutls/Dockerfile-3_8_0-x @@ -3,14 +3,13 @@ ARG VERSION ENV PKG_CONFIG_PATH=/build/lib/pkgconfig/ WORKDIR /src/ RUN git clone --depth=1 --branch ${VERSION} https://github.com/gnutls/gnutls -RUN apk update -RUN apk add gtk-doc guile guile-dev libtasn1-progs nettle-dev bison gperf wget +RUN apk add --no-cache gtk-doc guile guile-dev libtasn1-progs nettle-dev bison gperf wget WORKDIR /src/gnutls/ -RUN git submodule update --init --no-fetch -RUN mkdir /build/ -RUN ./bootstrap -RUN ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ -RUN make && make install +RUN git submodule update --init --no-fetch && \ + mkdir /build/ && \ + ./bootstrap && \ + ./configure --with-included-libtasn1 --with-included-unistring --disable-maintainer-mode --disable-doc --disable-full-test-suite --disable-cxx --disable-padlock --without-p11-kit --without-tpm --prefix=/build/ && \ + make -j"$(nproc)" && make install FROM entrypoint AS gnutls-base COPY --from=gnutls-gnutls /lib/ld-musl-x86_64.so.* \ diff --git a/src/main/resources/images/go/Dockerfile b/src/main/resources/images/go/Dockerfile index 068ffeb..1f9a3e0 100644 --- a/src/main/resources/images/go/Dockerfile +++ b/src/main/resources/images/go/Dockerfile @@ -1,7 +1,7 @@ FROM golang:1.9-alpine as go -ADD tls_server.go /go/src/tls_server/tls_server.go -RUN CGO_ENABLED=0 go install tls_server +COPY tls_server.go /go/src/tls_server/tls_server.go +RUN CGO_ENABLED=0 go install -ldflags="-s -w" tls_server FROM entrypoint COPY --from=go /go/bin/tls_server /bin/tls_server diff --git a/src/main/resources/images/jsse/Dockerfile b/src/main/resources/images/jsse/Dockerfile index 3d35a3c..cebcf1d 100644 --- a/src/main/resources/images/jsse/Dockerfile +++ b/src/main/resources/images/jsse/Dockerfile @@ -2,9 +2,11 @@ ARG JRE_VERSION=openjdk:7-jre-slim FROM maven:slim as maven ARG BC_VERSION=59 -RUN apt update && apt install -y git +RUN apt-get update && \ + apt-get install -y git && \ + rm -rf /var/lib/apt/lists/* WORKDIR /src -RUN git clone https://github.com/RUB-NDS/JsseTLS.git +RUN git clone --depth=1 https://github.com/RUB-NDS/JsseTLS.git WORKDIR /src/JsseTLS RUN mvn clean install -Dbc.version=1.${BC_VERSION} diff --git a/src/main/resources/images/libressl/Dockerfile-2_x b/src/main/resources/images/libressl/Dockerfile-2_x index 41c7eca..ade7e1a 100644 --- a/src/main/resources/images/libressl/Dockerfile-2_x +++ b/src/main/resources/images/libressl/Dockerfile-2_x @@ -1,17 +1,17 @@ FROM alpine-build:3.6 as libressl ARG VERSION -RUN wget -O libressl.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz -RUN mkdir libressl -RUN tar -xzf libressl.tar.gz -C libressl --strip-components 1 +RUN wget -O libressl.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz && \ + mkdir libressl && \ + tar -xzf libressl.tar.gz -C libressl --strip-components 1 && \ + rm libressl.tar.gz WORKDIR libressl RUN ./configure &&\ - make &&\ + make -j"$(nproc)" &&\ DESTDIR=/build/ make install # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/usr/local/lib/" ldd /build/usr/local/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -# .la cause problems when compiling other libs with this -RUN rm /build/usr/local/lib/*.la +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/usr/local/lib/" ldd /build/usr/local/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + rm /build/usr/local/lib/*.la FROM entrypoint as libressl-base COPY --from=libressl /build/usr/local/ /artifacts/ssllib/ diff --git a/src/main/resources/images/matrixssl/Dockerfile-3_7_2_and_3_4_0 b/src/main/resources/images/matrixssl/Dockerfile-3_7_2_and_3_4_0 index 5ddd6d3..551c0fb 100644 --- a/src/main/resources/images/matrixssl/Dockerfile-3_7_2_and_3_4_0 +++ b/src/main/resources/images/matrixssl/Dockerfile-3_7_2_and_3_4_0 @@ -2,9 +2,8 @@ FROM alpine-build:3.12 as matrixssl-base1 ARG VERSION RUN git clone --depth=1 --branch=v3.${VERSION} https://github.com/jurajsomorovsky/matrixssl.git WORKDIR matrixssl -RUN make -WORKDIR apps/ -RUN make +RUN make && \ + cd apps/ && make FROM entrypoint as matrixssl-base2 COPY --from=matrixssl-base1 /lib/ld-musl-x86_64.so.* /lib/ diff --git a/src/main/resources/images/matrixssl/Dockerfile-3_x b/src/main/resources/images/matrixssl/Dockerfile-3_x index 75ee30f..fc98aaa 100644 --- a/src/main/resources/images/matrixssl/Dockerfile-3_x +++ b/src/main/resources/images/matrixssl/Dockerfile-3_x @@ -1,14 +1,16 @@ FROM alpine-build:3.12 as matrixssl-base1 ARG VERSION ARG COMMIT -RUN git clone https://github.com/amitv87/matrixssl.git WORKDIR matrixssl -RUN git checkout ${COMMIT} -RUN sed -i 's/define ALLOW_ANON_CONNECTIONS 0/define ALLOW_ANON_CONNECTIONS 1/g' apps/ssl/client.c -RUN if [ "$VERSION" = "8.3" ]; then make; else make libs; fi; -RUN make apps_common || true -WORKDIR apps/ssl -RUN make +# only fetch the required commit instead of the whole history +RUN git init && \ + git remote add origin https://github.com/amitv87/matrixssl.git && \ + git fetch --depth 1 origin ${COMMIT} && \ + git checkout FETCH_HEAD && \ + sed -i 's/define ALLOW_ANON_CONNECTIONS 0/define ALLOW_ANON_CONNECTIONS 1/g' apps/ssl/client.c && \ + if [ "$VERSION" = "8.3" ]; then make; else make libs; fi && \ + (make apps_common || true) && \ + cd apps/ssl && make FROM entrypoint as matrixssl-base2 COPY --from=matrixssl-base1 /lib/ld-musl-x86_64.so.* /lib/ diff --git a/src/main/resources/images/matrixssl/Dockerfile-4_x b/src/main/resources/images/matrixssl/Dockerfile-4_x index ae24980..95eb327 100644 --- a/src/main/resources/images/matrixssl/Dockerfile-4_x +++ b/src/main/resources/images/matrixssl/Dockerfile-4_x @@ -1,11 +1,14 @@ FROM alpine-build:3.12 as matrixssl-base1 ARG VERSION ARG COMMIT -RUN git clone https://github.com/amitv87/matrixssl.git WORKDIR matrixssl -RUN git checkout ${COMMIT} -RUN sed -i 's/define ALLOW_ANON_CONNECTIONS 0/define ALLOW_ANON_CONNECTIONS 1/g' apps/ssl/client.c -RUN make +# only fetch the required commit instead of the whole history +RUN git init && \ + git remote add origin https://github.com/amitv87/matrixssl.git && \ + git fetch --depth 1 origin ${COMMIT} && \ + git checkout FETCH_HEAD && \ + sed -i 's/define ALLOW_ANON_CONNECTIONS 0/define ALLOW_ANON_CONNECTIONS 1/g' apps/ssl/client.c && \ + make FROM entrypoint as matrixssl-base2 COPY --from=matrixssl-base1 /lib/ld-musl-x86_64.so.* /lib/ diff --git a/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x b/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x index 1a260ef..1a6eb8a 100644 --- a/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x +++ b/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x @@ -1,11 +1,12 @@ FROM alpine-build:3.12 as mbed-base1 ARG VERSION -RUN wget -O mbed.tgz https://tls.mbed.org/download/mbedtls-${VERSION}-gpl.tgz -RUN mkdir mbed -RUN tar -xzf mbed.tgz -C mbed --strip-components 1 +RUN wget -O mbed.tgz https://tls.mbed.org/download/mbedtls-${VERSION}-gpl.tgz && \ + mkdir mbed && \ + tar -xzf mbed.tgz -C mbed --strip-components 1 && \ + rm mbed.tgz WORKDIR /build/ RUN cmake -DCMAKE_BUILD_TYPE=Release /src/mbed &&\ - make + make -j"$(nproc)" FROM entrypoint as mbed-base2 COPY --from=mbed-base1 /lib/ld-musl-x86_64.so.* /lib/ diff --git a/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x2 b/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x2 index c64f074..bf661f8 100644 --- a/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x2 +++ b/src/main/resources/images/mbedtls/Dockerfile-mbedtls_x2 @@ -1,13 +1,15 @@ FROM alpine-build:3.12 as mbedtls-base1 ARG VERSION -RUN python3 -m ensurepip --upgrade -RUN python3 -m pip install jsonschema jinja2 -RUN git clone --depth 1 --branch mbedtls-${VERSION} https://github.com/Mbed-TLS/mbedtls mbedtls -RUN cd mbedtls && git submodule update --init --recursive -RUN sed -i -e 's/ -Werror//g' /src/mbedtls/CMakeLists.txt +# jsonschema >= 4.18 depends on rpds-py, which has no usable wheel here and cannot be built from source, +# leading to pip backtracking through all rpds-py versions +RUN python3 -m ensurepip --upgrade && \ + python3 -m pip install --no-cache-dir "jsonschema<4.18" jinja2 +RUN git clone --depth 1 --branch mbedtls-${VERSION} https://github.com/Mbed-TLS/mbedtls mbedtls && \ + cd mbedtls && git submodule update --init --recursive --depth 1 && \ + sed -i -e 's/ -Werror//g' /src/mbedtls/CMakeLists.txt WORKDIR /build/ RUN cmake -DCMAKE_BUILD_TYPE=Release /src/mbedtls &&\ - make + make -j"$(nproc)" FROM entrypoint as mbedtls-base2 COPY --from=mbedtls-base1 /lib/ld-musl-x86_64.so.* /lib/ diff --git a/src/main/resources/images/mbedtls/Dockerfile-polarssl_under_1.2 b/src/main/resources/images/mbedtls/Dockerfile-polarssl_under_1.2 index 207b26f..ba737d6 100644 --- a/src/main/resources/images/mbedtls/Dockerfile-polarssl_under_1.2 +++ b/src/main/resources/images/mbedtls/Dockerfile-polarssl_under_1.2 @@ -1,11 +1,12 @@ FROM alpine-build:3.12 as polarssl-base1 ARG VERSION -RUN wget -O mbed.tgz https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/polarssl-${VERSION}.tar.gz -RUN mkdir mbed -RUN tar -xzf mbed.tgz -C mbed --strip-components 1 +RUN wget -O mbed.tgz https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/polarssl-${VERSION}.tar.gz && \ + mkdir mbed && \ + tar -xzf mbed.tgz -C mbed --strip-components 1 && \ + rm mbed.tgz WORKDIR /build/ RUN cmake -DCMAKE_BUILD_TYPE=Release /src/mbed &&\ - make + make -j"$(nproc)" FROM entrypoint as polarssl-base2 COPY --from=polarssl-base1 /lib/ld-musl-x86_64.so.* /lib/ diff --git a/src/main/resources/images/mbedtls/Dockerfile-polarssl_x b/src/main/resources/images/mbedtls/Dockerfile-polarssl_x index 222e5b5..9d0ca40 100644 --- a/src/main/resources/images/mbedtls/Dockerfile-polarssl_x +++ b/src/main/resources/images/mbedtls/Dockerfile-polarssl_x @@ -1,11 +1,12 @@ FROM alpine-build:3.12 as polarssl-base1 ARG VERSION -RUN wget -O mbed.tgz https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/polarssl-${VERSION}.tar.gz -RUN mkdir mbed -RUN tar -xzf mbed.tgz -C mbed --strip-components 1 +RUN wget -O mbed.tgz https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/polarssl-${VERSION}.tar.gz && \ + mkdir mbed && \ + tar -xzf mbed.tgz -C mbed --strip-components 1 && \ + rm mbed.tgz WORKDIR /build/ RUN cmake -DCMAKE_BUILD_TYPE=Release /src/mbed &&\ - make + make -j"$(nproc)" FROM entrypoint as polarssl-base2 COPY --from=mbed-base1 /lib/ld-musl-x86_64.so.* /lib/ diff --git a/src/main/resources/images/nss/Dockerfile b/src/main/resources/images/nss/Dockerfile index 094354b..be0f323 100644 --- a/src/main/resources/images/nss/Dockerfile +++ b/src/main/resources/images/nss/Dockerfile @@ -1,24 +1,22 @@ FROM alpine-build:3.12 AS nss ARG NSS_VERSION ARG NSPR_VERSION -RUN hg clone -r NSS_${NSS_VERSION} https://hg.mozilla.org/projects/nss -RUN hg clone -r NSPR_${NSPR_VERSION} https://hg.mozilla.org/projects/nspr -RUN apk add py3-pip && \ - apk add ninja && \ +RUN hg clone -r NSS_${NSS_VERSION} https://hg.mozilla.org/projects/nss && \ + hg clone -r NSPR_${NSPR_VERSION} https://hg.mozilla.org/projects/nspr +RUN apk add --no-cache py3-pip ninja && \ ln -s /usr/bin/python3 /usr/bin/python && \ - pip install setuptools && \ - git clone https://chromium.googlesource.com/external/gyp && \ + pip install --no-cache-dir setuptools && \ + git clone --depth=1 https://chromium.googlesource.com/external/gyp && \ cd gyp && python3 ./setup.py install WORKDIR /src/nss -RUN cat coreconf/werror.py RUN ./build.sh --opt # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/src/dist/Release/lib/" ldd /src/dist/Release/bin/selfserv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/src/dist/Release/lib/" ldd /src/dist/Release/bin/tstclnt | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ # just add all other libs, as some are loaded dynamically... -RUN cp -r /src/nss/out/Release/* /libdeps/ -RUN cp -r /src/dist/Release/lib/* /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/src/dist/Release/lib/" ldd /src/dist/Release/bin/selfserv | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/src/dist/Release/lib/" ldd /src/dist/Release/bin/tstclnt | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp -r /src/nss/out/Release/* /libdeps/ && \ + cp -r /src/dist/Release/lib/* /libdeps/ FROM entrypoint AS nss-base COPY --from=nss /src/dist/public/nss/ /src/dist/Release/include/nspr /artifacts/ssllib/include/ diff --git a/src/main/resources/images/nss/Dockerfile_pre_3_36_8 b/src/main/resources/images/nss/Dockerfile_pre_3_36_8 index 7fa0f4e..96d94f3 100644 --- a/src/main/resources/images/nss/Dockerfile_pre_3_36_8 +++ b/src/main/resources/images/nss/Dockerfile_pre_3_36_8 @@ -1,13 +1,11 @@ FROM alpine-build:3.6 as nss ARG NSS_VERSION ARG NSPR_VERSION -RUN hg clone -r NSS_${NSS_VERSION} https://hg.mozilla.org/projects/nss -RUN hg clone -r NSPR_${NSPR_VERSION} https://hg.mozilla.org/projects/nspr -RUN apk add py-pip && \ - apk add ninja && \ - pip install setuptools && \ - pip install six && \ - git clone https://chromium.googlesource.com/external/gyp && \ +RUN hg clone -r NSS_${NSS_VERSION} https://hg.mozilla.org/projects/nss && \ + hg clone -r NSPR_${NSPR_VERSION} https://hg.mozilla.org/projects/nspr +RUN apk add --no-cache py-pip ninja && \ + pip install --no-cache-dir setuptools six && \ + git clone --depth=1 https://chromium.googlesource.com/external/gyp && \ cd gyp && ./setup.py install WORKDIR /src/nss RUN ./build.sh diff --git a/src/main/resources/images/ocamltls/Dockerfile b/src/main/resources/images/ocamltls/Dockerfile index abee692..c7fd380 100644 --- a/src/main/resources/images/ocamltls/Dockerfile +++ b/src/main/resources/images/ocamltls/Dockerfile @@ -1,21 +1,19 @@ FROM ocaml/opam as ocamltls-base1 ARG VERSION -RUN sudo apt install -y libgmp-dev m4 pkg-config +RUN sudo apt-get update && \ + sudo apt-get install -y libgmp-dev m4 pkg-config WORKDIR /home/opam/opam-repository -RUN git checkout -B master origin/master -RUN opam update +RUN git checkout -B master origin/master && \ + opam update RUN git clone --depth=1 --branch=${VERSION} https://github.com/mirleft/ocaml-tls WORKDIR /home/opam/ocaml-tls -RUN sed -i -e 's~\./certificates/server\.pem~/cert/rsa2048cert\.pem~g' lwt/examples/ex_common.ml -RUN sed -i -e 's~\./certificates/server\.key~/cert/rsa2048key\.pem~g' lwt/examples/ex_common.ml +RUN sed -i -e 's~\./certificates/server\.pem~/cert/rsa2048cert\.pem~g' \ + -e 's~\./certificates/server\.key~/cert/rsa2048key\.pem~g' lwt/examples/ex_common.ml RUN eval `opam config env` &&\ opam install -y topkg topkg-care cstruct nocrypto x509 ppx_cstruct oUnit cstruct-unix RUN eval `opam config env` &&\ - opam install . -RUN eval `opam config env` &&\ - dune build lwt/examples/fuzz_server.exe -RUN eval `opam config env` &&\ - dune build lwt/examples/test_client.exe + opam install . &&\ + dune build lwt/examples/fuzz_server.exe lwt/examples/test_client.exe FROM entrypoint as ocamltls-base2 diff --git a/src/main/resources/images/openhitls/Dockerfile-0_2_x b/src/main/resources/images/openhitls/Dockerfile-0_2_x index 5044609..e727843 100644 --- a/src/main/resources/images/openhitls/Dockerfile-0_2_x +++ b/src/main/resources/images/openhitls/Dockerfile-0_2_x @@ -1,30 +1,28 @@ FROM debian-build:bullseye AS openhitls-base1 ARG VERSION -RUN apt-get update && apt-get install -y libsctp-dev +RUN apt-get update && \ + apt-get install -y --no-install-recommends libsctp-dev && \ + rm -rf /var/lib/apt/lists/* WORKDIR /src/ RUN git clone --recurse-submodules https://github.com/openHiTLS/openHiTLS.git WORKDIR /src/openHiTLS RUN git checkout openhitls-0.2.${VERSION} -COPY ./0.2.x_patches/server.c /src/openHiTLS/testcode/demo/server.c -COPY ./0.2.x_patches/client.c /src/openHiTLS/testcode/demo/client.c -RUN mkdir build +COPY ./0.2.x_patches/server.c ./0.2.x_patches/client.c /src/openHiTLS/testcode/demo/ WORKDIR /src/openHiTLS/build RUN python3 ../configure.py --enable hitls_bsl hitls_crypto hitls_tls hitls_pki hitls_auth --lib_type static --add_options="-DHITLS_EAL_INIT_OPTS=9 -DHITLS_CRYPTO_ASM_CHECK -DHITLS_CRYPTO_ENTROPY -DHITLS_CRYPTO_ENTROPY_DEVRANDOM -DHITLS_CRYPTO_ENTROPY_GETENTROPY -DHITLS_CRYPTO_ENTROPY_SYS -DHITLS_CRYPTO_ENTROPY_HARDWARE -DHITLS_CRYPTO_DRBG_GM -DTLS_DEBUG=ON -fprofile-arcs -ftest-coverage" --bits=64 --system=linux --add_link_flags="-ldl" && cmake .. RUN make -j WORKDIR /src/openHiTLS/testcode/script #RUN bash build_sdv.sh tls-debug no-sctp asan gcov RUN bash build_sdv.sh tls-debug no-sctp gcov -RUN mkdir /libdeps64/ -RUN mkdir /libdeps/ -RUN bash -c 'ldd /src/openHiTLS/testcode/demo/build/client | awk '\''{if ($3 != "" || NF == 2) print ($3 != "" ? $3 : $1)}'\'' | while read -r lib; do [ -f "$lib" ] && { [[ "$lib" == /lib64/* ]] && cp "$lib" /libdeps64/ || cp "$lib" /libdeps/; }; done' -RUN bash -c 'ldd /src/openHiTLS/testcode/demo/build/server | awk '\''{if ($3 != "" || NF == 2) print ($3 != "" ? $3 : $1)}'\'' | while read -r lib; do [ -f "$lib" ] && { [[ "$lib" == /lib64/* ]] && cp "$lib" /libdeps64/ || cp "$lib" /libdeps/; }; done' +RUN mkdir /libdeps64/ /libdeps/ && \ + bash -c 'ldd /src/openHiTLS/testcode/demo/build/client | awk '\''{if ($3 != "" || NF == 2) print ($3 != "" ? $3 : $1)}'\'' | while read -r lib; do [ -f "$lib" ] && { [[ "$lib" == /lib64/* ]] && cp "$lib" /libdeps64/ || cp "$lib" /libdeps/; }; done' && \ + bash -c 'ldd /src/openHiTLS/testcode/demo/build/server | awk '\''{if ($3 != "" || NF == 2) print ($3 != "" ? $3 : $1)}'\'' | while read -r lib; do [ -f "$lib" ] && { [[ "$lib" == /lib64/* ]] && cp "$lib" /libdeps64/ || cp "$lib" /libdeps/; }; done' # using debian base image as dns resolution seems to be broken in entrypoint image FROM debian:bullseye AS openhitls-base2 COPY --from=entrypoint /bin/* /bin/ -COPY --from=openhitls-base1 /src/openHiTLS/testcode/demo/build/server /bin/ -COPY --from=openhitls-base1 /src/openHiTLS/testcode/demo/build/client /bin/ +COPY --from=openhitls-base1 /src/openHiTLS/testcode/demo/build/server /src/openHiTLS/testcode/demo/build/client /bin/ COPY --from=openhitls-base1 /libdeps/* /lib/ COPY --from=openhitls-base1 /libdeps64/* /lib64/ COPY --from=openhitls-base1 /src/openHiTLS/testcode/testdata/tls/certificate/der/ecdsa_sha256 /certs/ diff --git a/src/main/resources/images/openssl/Dockerfile-0_9_6x b/src/main/resources/images/openssl/Dockerfile-0_9_6x index fe329a3..df1b8aa 100644 --- a/src/main/resources/images/openssl/Dockerfile-0_9_6x +++ b/src/main/resources/images/openssl/Dockerfile-0_9_6x @@ -1,21 +1,20 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -RUN mv Makefile.ssl tmp && sed "s/-m486/-m16/g" tmp > Makefile.ssl -RUN mv Makefile.org tmp && sed "s/-m486/-m16/g" tmp > Makefile.org -RUN mv Configure tmp && sed "s/-m486/-m16/g" tmp > Configure COPY read_pwd_termios.patch ./ -RUN patch crypto/des/read_pwd.c < read_pwd_termios.patch +RUN sed -i "s/-m486/-m16/g" Makefile.ssl Makefile.org Configure && \ + patch crypto/des/read_pwd.c < read_pwd_termios.patch -RUN ./config --prefix=/build/ --openssldir=/build/ no-async no-asm -fPIC -RUN make && make install +RUN ./config --prefix=/build/ --openssldir=/build/ no-async no-asm -fPIC && \ + make && make install #todo: fix error: "4-byte relocation cannot be applied to 2-byte field" # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-0_9_7x b/src/main/resources/images/openssl/Dockerfile-0_9_7x index 43e6c21..8128f8c 100644 --- a/src/main/resources/images/openssl/Dockerfile-0_9_7x +++ b/src/main/resources/images/openssl/Dockerfile-0_9_7x @@ -1,16 +1,17 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl COPY openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install -s +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-0_9_8a-n b/src/main/resources/images/openssl/Dockerfile-0_9_8a-n index 5a15115..374c26d 100644 --- a/src/main/resources/images/openssl/Dockerfile-0_9_8a-n +++ b/src/main/resources/images/openssl/Dockerfile-0_9_8a-n @@ -1,18 +1,19 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl COPY openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch -RUN ./config --prefix=/build/ --openssldir=/build/ no-async no-asm -fPIC # 0.9.8a-n need "no-asm -fPIC" flags -RUN make -s && make install_sw -s # install_sw for not creating manpages, a lot openssl versions (<0.9.8zc) do not compile with make install + it is faster +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async no-asm -fPIC && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-0_9_8m-zh b/src/main/resources/images/openssl/Dockerfile-0_9_8m-zh index 3e874d5..6c66861 100644 --- a/src/main/resources/images/openssl/Dockerfile-0_9_8m-zh +++ b/src/main/resources/images/openssl/Dockerfile-0_9_8m-zh @@ -1,17 +1,18 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/0.9.x/openssl-0.9.${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl COPY openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install_sw -s # install_sw for not creating manpages, a lot openssl versions (<8zc) do not compile with make install + it is faster +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-0_9_8zh b/src/main/resources/images/openssl/Dockerfile-0_9_8zh index 462a68b..f7e5837 100644 --- a/src/main/resources/images/openssl/Dockerfile-0_9_8zh +++ b/src/main/resources/images/openssl/Dockerfile-0_9_8zh @@ -1,12 +1,14 @@ FROM alpine-build:3.12 as openssl-base1 -RUN wget https://www.openssl.org/source/old/0.9.x/openssl-0.9.8zh.tar.gz -RUN tar -xzf openssl-0.9.8zh.tar.gz +RUN wget https://www.openssl.org/source/old/0.9.x/openssl-0.9.8zh.tar.gz && \ + tar -xzf openssl-0.9.8zh.tar.gz && \ + rm openssl-0.9.8zh.tar.gz WORKDIR /src/openssl-0.9.8zh -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install -s +# install_sw for not creating manpages +RUN ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_0beta1-4 b/src/main/resources/images/openssl/Dockerfile-1_0_0beta1-4 index 0042e37..e8cbcbc 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_0beta1-4 +++ b/src/main/resources/images/openssl/Dockerfile-1_0_0beta1-4 @@ -1,17 +1,17 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.0/openssl-1.0.0${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.0/openssl-1.0.0${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl COPY openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch - -RUN ./config --prefix=/build/ --openssldir=/build/ no-async no-asm -fPIC -RUN make -s && make install_sw -s +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async no-asm -fPIC && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_0x b/src/main/resources/images/openssl/Dockerfile-1_0_0x index 7ccc303..148eef1 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_0x +++ b/src/main/resources/images/openssl/Dockerfile-1_0_0x @@ -1,17 +1,17 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.0/openssl-1.0.0${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.0/openssl-1.0.0${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -COPY /openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch - -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install_sw -s +COPY openssl-004-musl-termios.patch ./ +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_1m-u b/src/main/resources/images/openssl/Dockerfile-1_0_1m-u index e3388f6..28bce84 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_1m-u +++ b/src/main/resources/images/openssl/Dockerfile-1_0_1m-u @@ -1,17 +1,18 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.1/openssl-1.0.1${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.1/openssl-1.0.1${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl #COPY openssl-004-musl-termios.patch ./ #RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install_sw -s +RUN ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_1x b/src/main/resources/images/openssl/Dockerfile-1_0_1x index f1abb94..79e1688 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_1x +++ b/src/main/resources/images/openssl/Dockerfile-1_0_1x @@ -1,17 +1,17 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.1/openssl-1.0.1${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.1/openssl-1.0.1${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl COPY openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch - -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install_sw -s +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_2 b/src/main/resources/images/openssl/Dockerfile-1_0_2 index 51de6d9..d149109 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_2 +++ b/src/main/resources/images/openssl/Dockerfile-1_0_2 @@ -1,14 +1,16 @@ FROM alpine-build:3.12 as openssl-base1 -RUN wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2.tar.gz -RUN tar -xzf openssl-1.0.2.tar.gz +RUN wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2.tar.gz && \ + tar -xzf openssl-1.0.2.tar.gz && \ + rm openssl-1.0.2.tar.gz WORKDIR /src/openssl-1.0.2 COPY openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make && make test && make install +# install_sw for not creating manpages +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make && make test && make install_sw # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_2_and_betas b/src/main/resources/images/openssl/Dockerfile-1_0_2_and_betas index 79f05a5..76abfaf 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_2_and_betas +++ b/src/main/resources/images/openssl/Dockerfile-1_0_2_and_betas @@ -1,16 +1,17 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.2/openssl-1.0.2${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.2/openssl-1.0.2${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -COPY /openssl-004-musl-termios.patch ./ -RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install_sw -s +COPY openssl-004-musl-termios.patch ./ +RUN patch crypto/ui/ui_openssl.c < openssl-004-musl-termios.patch && \ + ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_2l b/src/main/resources/images/openssl/Dockerfile-1_0_2l index 0668323..6835e21 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_2l +++ b/src/main/resources/images/openssl/Dockerfile-1_0_2l @@ -1,12 +1,14 @@ FROM alpine-build:3.12 as openssl-base1 -RUN wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz -RUN tar -xzf openssl-1.0.2l.tar.gz +RUN wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz && \ + tar -xzf openssl-1.0.2l.tar.gz && \ + rm openssl-1.0.2l.tar.gz WORKDIR /src/openssl-1.0.2l -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make && make test && make install +# install_sw for not creating manpages +RUN ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make && make test && make install_sw # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_0_2x b/src/main/resources/images/openssl/Dockerfile-1_0_2x index 61959d4..32e2fee 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_0_2x +++ b/src/main/resources/images/openssl/Dockerfile-1_0_2x @@ -1,14 +1,15 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.2/openssl-1.0.2${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-1.0.2${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN (wget -O openssl.tar.gz https://www.openssl.org/source/old/1.0.2/openssl-1.0.2${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-1.0.2${VERSION}.tar.gz) && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install_sw -s +RUN ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_1_0-pre1and2 b/src/main/resources/images/openssl/Dockerfile-1_1_0-pre1and2 index f6cdf43..0deb791 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_1_0-pre1and2 +++ b/src/main/resources/images/openssl/Dockerfile-1_1_0-pre1and2 @@ -1,14 +1,16 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.1.0/openssl-1.1.0${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.1.0/openssl-1.1.0${VERSION}.tar.gz && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -RUN ./config --prefix=/build/ --openssldir=/build/ #pre1 and pre2 do not support no-async -RUN make -s && make install_sw -s +#pre1 and pre2 do not support no-async +RUN ./config --prefix=/build/ --openssldir=/build/ && \ + make -s && make install_sw -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_1_0f b/src/main/resources/images/openssl/Dockerfile-1_1_0f index d826734..e6ce7b0 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_1_0f +++ b/src/main/resources/images/openssl/Dockerfile-1_1_0f @@ -1,12 +1,14 @@ FROM alpine-build:3.12 as openssl-base1 -RUN wget https://www.openssl.org/source/old/1.1.0/openssl-1.1.0f.tar.gz -RUN tar -xzf openssl-1.1.0f.tar.gz +RUN wget https://www.openssl.org/source/old/1.1.0/openssl-1.1.0f.tar.gz && \ + tar -xzf openssl-1.1.0f.tar.gz && \ + rm openssl-1.1.0f.tar.gz WORKDIR /src/openssl-1.1.0f -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make -s && make install -s +# install_sw + install_ssldirs is make install without the documentation +RUN ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -s -j"$(nproc)" && make install_sw install_ssldirs -s # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_1_0x b/src/main/resources/images/openssl/Dockerfile-1_1_0x index df0bc1c..65b37f2 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_1_0x +++ b/src/main/resources/images/openssl/Dockerfile-1_1_0x @@ -1,14 +1,16 @@ FROM alpine-build:3.6 as openssl-base1 ARG VERSION -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.1.0/openssl-1.1.0${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-1.1.0${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN (wget -O openssl.tar.gz https://www.openssl.org/source/old/1.1.0/openssl-1.1.0${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-1.1.0${VERSION}.tar.gz) && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -RUN ./config --prefix=/build/ --openssldir=/build/ no-async -RUN make && make install +# install_sw + install_ssldirs is make install without the documentation +RUN ./config --prefix=/build/ --openssldir=/build/ no-async && \ + make -j"$(nproc)" && make install_sw install_ssldirs # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-1_1_1x b/src/main/resources/images/openssl/Dockerfile-1_1_1x index b5d79db..879ed98 100644 --- a/src/main/resources/images/openssl/Dockerfile-1_1_1x +++ b/src/main/resources/images/openssl/Dockerfile-1_1_1x @@ -1,15 +1,17 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION ARG BUILD_FLAGS="" -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/1.1.1/openssl-1.1.1${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-1.1.1${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN (wget -O openssl.tar.gz https://www.openssl.org/source/old/1.1.1/openssl-1.1.1${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-1.1.1${VERSION}.tar.gz) && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -RUN ./config --prefix=/build/ --openssldir=/build/ no-async ${BUILD_FLAGS} -RUN make && make install +# install_sw + install_ssldirs is make install without the documentation +RUN ./config --prefix=/build/ --openssldir=/build/ no-async ${BUILD_FLAGS} && \ + make -j"$(nproc)" && make install_sw install_ssldirs # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-3_x b/src/main/resources/images/openssl/Dockerfile-3_x index d2c32d7..a075323 100644 --- a/src/main/resources/images/openssl/Dockerfile-3_x +++ b/src/main/resources/images/openssl/Dockerfile-3_x @@ -1,20 +1,18 @@ FROM alpine-build:3.12 as openssl-base1 ARG VERSION ARG BUILD_FLAGS="" -RUN wget -O openssl.tar.gz https://www.openssl.org/source/old/3.0/openssl-3.${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-3.${VERSION}.tar.gz -RUN mkdir openssl -RUN tar -xzf openssl.tar.gz -C openssl --strip-components 1 +RUN (wget -O openssl.tar.gz https://www.openssl.org/source/old/3.0/openssl-3.${VERSION}.tar.gz || wget -O openssl.tar.gz https://www.openssl.org/source/openssl-3.${VERSION}.tar.gz) && \ + mkdir openssl && \ + tar -xzf openssl.tar.gz -C openssl --strip-components 1 && \ + rm openssl.tar.gz WORKDIR /src/openssl -RUN ./config --prefix=/build/ --openssldir=/build/ no-async ${BUILD_FLAGS} -RUN make && make install -RUN ls -lh util/ +# install_sw + install_ssldirs is make install without the documentation +RUN ./config --prefix=/build/ --openssldir=/build/ no-async ${BUILD_FLAGS} && \ + make -j"$(nproc)" && make install_sw install_ssldirs # copy all libs we need -RUN mkdir /libdeps -RUN find . -name 'libcrypto.so.3' -RUN cp libcrypto.so.3 /usr/lib/ -RUN cp libcrypto.a /usr/lib/ -RUN cp libssl.so.3 /usr/lib/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp libcrypto.so.3 libcrypto.a libssl.so.3 /usr/lib/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/openssl/Dockerfile-4_x b/src/main/resources/images/openssl/Dockerfile-4_x index 157e37e..e733371 100644 --- a/src/main/resources/images/openssl/Dockerfile-4_x +++ b/src/main/resources/images/openssl/Dockerfile-4_x @@ -1,19 +1,18 @@ FROM alpine-build:3.17 AS openssl-base1 ARG VERSION ARG BUILD_FLAGS="" -RUN apk add git -RUN git clone https://github.com/openssl/openssl.git --depth 1 --branch openssl-4.${VERSION} -RUN apk del openssl +RUN apk add --no-cache git && \ + git clone https://github.com/openssl/openssl.git --depth 1 --branch openssl-4.${VERSION} && \ + apk del openssl WORKDIR /src/openssl -RUN ./config --prefix=/build/ --openssldir=/build/ no-async ${BUILD_FLAGS} -RUN make && make install +# install_sw + install_ssldirs is make install without the documentation +RUN ./config --prefix=/build/ --openssldir=/build/ no-async ${BUILD_FLAGS} && \ + make -j"$(nproc)" && make install_sw install_ssldirs # copy all libs we need -RUN mkdir /libdeps -RUN cp libcrypto.so.4 /usr/lib/ -RUN cp libcrypto.a /usr/lib/ -RUN cp libssl.so.4 /usr/lib/ -RUN cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp libcrypto.so.4 libcrypto.a libssl.so.4 /usr/lib/ && \ + cp $(LD_LIBRARY_PATH="/build/lib/" ldd /build/bin/openssl | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint AS openssl-base2 COPY --from=openssl-base1 /build/ /artifacts/ssllib/ diff --git a/src/main/resources/images/pyopenssl/Dockerfile b/src/main/resources/images/pyopenssl/Dockerfile index cfb67ff..59a9513 100644 --- a/src/main/resources/images/pyopenssl/Dockerfile +++ b/src/main/resources/images/pyopenssl/Dockerfile @@ -16,8 +16,7 @@ LABEL "tls_implementation_version"="${VERSION}" LABEL "tls_implementation_connectionRole"="server" COPY --from=py-openssl /src/pyopenssl/examples/* /src/ COPY --from=py-openssl /src/pyopenssl/examples/simple/* /src/simple/ -COPY --from=py-openssl /usr/lib/python2.7/site-packages/*.egg /usr/local/lib/python2.7/site-packages/ -COPY --from=py-openssl /usr/lib/python2.7/site-packages/easy-install.pth /usr/local/lib/python2.7/site-packages/ +COPY --from=py-openssl /usr/lib/python2.7/site-packages/*.egg /usr/lib/python2.7/site-packages/easy-install.pth /usr/local/lib/python2.7/site-packages/ COPY --from=py-openssl /usr/lib/libffi.so.6 /usr/lib/libssl.so.1.0.0 /usr/lib/libcrypto.so.1.0.0 /usr/local/lib/ COPY --from=entrypoint /bin/server-entrypoint /bin/ COPY server.py /src/simple/ diff --git a/src/main/resources/images/python-gnutls/Dockerfile b/src/main/resources/images/python-gnutls/Dockerfile index 3ffb4e3..2628586 100644 --- a/src/main/resources/images/python-gnutls/Dockerfile +++ b/src/main/resources/images/python-gnutls/Dockerfile @@ -1,10 +1,11 @@ FROM alpine-build:3.12 as python-gnutls ARG VERSION RUN apk add --no-cache mbedtls-dev py-setuptools python2-dev py-twisted gnutls -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN python get-pip.py +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python get-pip.py --no-cache-dir && \ + rm get-pip.py && \ + pip2 install --no-cache-dir incremental constantly packaging RUN git clone --depth=1 --branch=${VERSION} https://github.com/AGProjects/python-gnutls -RUN pip2 install incremental constantly packaging WORKDIR python-gnutls RUN python setup.py build && python setup.py install COPY server.py /src/python-gnutls/examples diff --git a/src/main/resources/images/python-mbedtls/Dockerfile b/src/main/resources/images/python-mbedtls/Dockerfile index 3dba25b..2402655 100644 --- a/src/main/resources/images/python-mbedtls/Dockerfile +++ b/src/main/resources/images/python-mbedtls/Dockerfile @@ -1,9 +1,10 @@ FROM alpine-build:3.12 as python-mbedtls ARG VERSION RUN apk add --no-cache mbedtls-dev py-setuptools python2-dev -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN python get-pip.py -RUN pip install contextlib2 pytest enum34 ipaddress certifi +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python get-pip.py --no-cache-dir && \ + rm get-pip.py && \ + pip install --no-cache-dir contextlib2 pytest enum34 ipaddress certifi RUN git clone --depth=1 --branch=${VERSION} https://github.com/Synss/python-mbedtls WORKDIR python-mbedtls RUN python setup.py build && python setup.py install @@ -17,12 +18,10 @@ LABEL "tls_implementation_version"="${VERSION}" LABEL "tls_implementation_connectionRole"="server" COPY --from=python-mbedtls /src/python-mbedtls/tests /src/ COPY tls_server.py /src/ -COPY --from=python-mbedtls /usr/lib/python2.7/site-packages/easy-install.pth /usr/lib/python2.7/site-packages/python_mbedtls-${VERSION}-py2.7-linux-x86_64.egg /usr/local/lib/python2.7/site-packages/ +COPY --from=python-mbedtls /usr/lib/python2.7/site-packages/easy-install.pth /usr/lib/python2.7/site-packages/python_mbedtls-${VERSION}-py2.7-linux-x86_64.egg /usr/lib/python2.7/site-packages/contextlib2.pyc /usr/lib/python2.7/site-packages/ipaddress.pyc /usr/local/lib/python2.7/site-packages/ COPY --from=python-mbedtls /usr/lib/libmbed* /usr/local/lib/ -COPY --from=python-mbedtls /usr/lib/python2.7/site-packages/contextlib2.pyc /usr/local/lib/python2.7/site-packages/ COPY --from=python-mbedtls /usr/lib/python2.7/site-packages/enum/ /usr/local/lib/python2.7/site-packages/enum/ COPY --from=python-mbedtls /usr/lib/python2.7/site-packages/certifi/ /usr/local/lib/python2.7/site-packages/certifi/ -COPY --from=python-mbedtls /usr/lib/python2.7/site-packages/ipaddress.pyc /usr/local/lib/python2.7/site-packages/ COPY --from=entrypoint /bin/server-entrypoint /bin/ WORKDIR /src ENTRYPOINT ["server-entrypoint", "python","tls_server.py"] diff --git a/src/main/resources/images/python-mbedtls/Dockerfile_old b/src/main/resources/images/python-mbedtls/Dockerfile_old index c3db94a..2f6475d 100644 --- a/src/main/resources/images/python-mbedtls/Dockerfile_old +++ b/src/main/resources/images/python-mbedtls/Dockerfile_old @@ -1,9 +1,10 @@ FROM alpine-build:3.12 as python-mbedtls ARG VERSION RUN apk add --no-cache mbedtls-dev py-setuptools python-dev -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN python get-pip.py -RUN pip install contextlib2 pytest enum34 ipaddress certifi +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python get-pip.py --no-cache-dir && \ + rm get-pip.py && \ + pip install --no-cache-dir contextlib2 pytest enum34 ipaddress certifi RUN git clone --depth=1 --branch=${VERSION} https://github.com/Synss/python-mbedtls WORKDIR python-mbedtls RUN python setup.py build && python setup.py install diff --git a/src/main/resources/images/rustls/Dockerfile b/src/main/resources/images/rustls/Dockerfile index 8363c69..035a8c8 100644 --- a/src/main/resources/images/rustls/Dockerfile +++ b/src/main/resources/images/rustls/Dockerfile @@ -4,7 +4,6 @@ WORKDIR /src/ RUN git clone --branch=v/${VERSION} --depth=1 https://github.com/ctz/rustls WORKDIR rustls/rustls-mio RUN cargo build --release -RUN cargo build --release FROM debian:stable-slim as rustls-base2 FROM entrypoint as entrypoint diff --git a/src/main/resources/images/rustls/Dockerfile-23_34_x509_anvil b/src/main/resources/images/rustls/Dockerfile-23_34_x509_anvil index a17da85..13eb56b 100644 --- a/src/main/resources/images/rustls/Dockerfile-23_34_x509_anvil +++ b/src/main/resources/images/rustls/Dockerfile-23_34_x509_anvil @@ -4,8 +4,7 @@ RUN git clone --branch=v/0.23.34 --depth=1 https://github.com/rustls/rustls WORKDIR /src/rustls/ COPY rustls_23_34_x509.patch /src/rustls/rustls_23_34_x509.patch RUN git apply /src/rustls/rustls_23_34_x509.patch -RUN cargo build --bin tlsserver-mio --release -RUN cargo build --bin tlsclient-mio --release +RUN cargo build --bin tlsserver-mio --bin tlsclient-mio --release FROM debian:stable-slim AS rustls-base2 FROM entrypoint AS entrypoint diff --git a/src/main/resources/images/rustls/Dockerfile_12_0-15_1 b/src/main/resources/images/rustls/Dockerfile_12_0-15_1 index 79e2c48..f46e008 100644 --- a/src/main/resources/images/rustls/Dockerfile_12_0-15_1 +++ b/src/main/resources/images/rustls/Dockerfile_12_0-15_1 @@ -3,8 +3,7 @@ ARG VERSION WORKDIR /src/ RUN git clone --branch=v/${VERSION} --depth=1 https://github.com/ctz/rustls WORKDIR rustls -RUN cargo build --release --example tlsserver --features "dangerous_configuration" -RUN cargo build --release --example tlsclient --features "dangerous_configuration" +RUN cargo build --release --example tlsserver --example tlsclient --features "dangerous_configuration" FROM debian:stable-slim as rustls-base2 FROM entrypoint as entrypoint diff --git a/src/main/resources/images/rustls/Dockerfile_15_2-16_0 b/src/main/resources/images/rustls/Dockerfile_15_2-16_0 index db07094..ba749fb 100644 --- a/src/main/resources/images/rustls/Dockerfile_15_2-16_0 +++ b/src/main/resources/images/rustls/Dockerfile_15_2-16_0 @@ -3,8 +3,7 @@ ARG VERSION WORKDIR /src/ RUN git clone --branch=v/${VERSION} --depth=1 https://github.com/ctz/rustls WORKDIR rustls/rustls-mio -RUN cargo build --release --example tlsserver --features "dangerous_configuration" -RUN cargo build --release --example tlsclient --features "dangerous_configuration" +RUN cargo build --release --example tlsserver --example tlsclient --features "dangerous_configuration" FROM debian:stable-slim as rustls-base2 FROM entrypoint as entrypoint diff --git a/src/main/resources/images/rustls/Dockerfile_17-19_0 b/src/main/resources/images/rustls/Dockerfile_17-19_0 index 5efb836..75ab6e5 100644 --- a/src/main/resources/images/rustls/Dockerfile_17-19_0 +++ b/src/main/resources/images/rustls/Dockerfile_17-19_0 @@ -3,8 +3,7 @@ ARG VERSION WORKDIR /src/ RUN git clone --branch=v/${VERSION} --depth=1 https://github.com/ctz/rustls WORKDIR rustls/rustls-mio -RUN cargo build --release --example tlsserver --features "dangerous_configuration" -RUN cargo build --release --example tlsclient --features "dangerous_configuration" +RUN cargo build --release --example tlsserver --example tlsclient --features "dangerous_configuration" FROM debian:stable-slim as rustls-base2 FROM entrypoint as entrypoint diff --git a/src/main/resources/images/rustls/Dockerfile_23_x b/src/main/resources/images/rustls/Dockerfile_23_x index b7aa29a..e9605df 100644 --- a/src/main/resources/images/rustls/Dockerfile_23_x +++ b/src/main/resources/images/rustls/Dockerfile_23_x @@ -3,8 +3,7 @@ ARG VERSION WORKDIR /src/ RUN git clone --branch=v/${VERSION} --depth=1 https://github.com/rustls/rustls WORKDIR rustls/rustls-mio -RUN cargo build --bin tlsserver-mio --release -RUN cargo build --bin tlsclient-mio --release +RUN cargo build --bin tlsserver-mio --bin tlsclient-mio --release FROM debian:stable-slim as rustls-base2 FROM entrypoint as entrypoint diff --git a/src/main/resources/images/s2n/Dockerfile b/src/main/resources/images/s2n/Dockerfile index f739d40..dde10e7 100644 --- a/src/main/resources/images/s2n/Dockerfile +++ b/src/main/resources/images/s2n/Dockerfile @@ -1,6 +1,8 @@ FROM debian-build:bullseye as s2n-base1 ARG VERSION -RUN apt-get update && apt-get install -y libssl-dev +RUN apt-get update && \ + apt-get install -y --no-install-recommends libssl-dev && \ + rm -rf /var/lib/apt/lists/* RUN git clone --branch=v${VERSION} --depth=1 https://github.com/awslabs/s2n WORKDIR s2n RUN make bin diff --git a/src/main/resources/images/tlslite_ng/Dockerfile_python2 b/src/main/resources/images/tlslite_ng/Dockerfile_python2 index 2507a06..410b7c8 100644 --- a/src/main/resources/images/tlslite_ng/Dockerfile_python2 +++ b/src/main/resources/images/tlslite_ng/Dockerfile_python2 @@ -1,6 +1,6 @@ FROM python:2.7-alpine as tlslite-ng ARG VERSION -RUN apk update && apk add git make +RUN apk add --no-cache git make RUN git clone --depth=1 --branch=v${VERSION} https://github.com/tomato42/tlslite-ng || git clone --depth=1 --branch=${VERSION} https://github.com/tomato42/tlslite-ng WORKDIR tlslite-ng RUN python setup.py build && python setup.py install diff --git a/src/main/resources/images/tlslite_ng/Dockerfile_python3 b/src/main/resources/images/tlslite_ng/Dockerfile_python3 index 3c1df52..9e7d4c0 100644 --- a/src/main/resources/images/tlslite_ng/Dockerfile_python3 +++ b/src/main/resources/images/tlslite_ng/Dockerfile_python3 @@ -1,16 +1,16 @@ FROM python:3.3-alpine as tlslite-ng ARG VERSION -RUN apk update && apk add git make -RUN apk --no-cache add curl -RUN curl -sS https://bootstrap.pypa.io/pip/3.3/get-pip.py -o get-pip.py -RUN python get-pip.py +RUN apk add --no-cache git make curl && \ + curl -sS https://bootstrap.pypa.io/pip/3.3/get-pip.py -o get-pip.py && \ + python get-pip.py --no-cache-dir && \ + rm get-pip.py RUN git clone --depth=1 --branch=v${VERSION} https://github.com/tomato42/tlslite-ng WORKDIR tlslite-ng -RUN pip install ecdsa -RUN python setup.py install -RUN make test +RUN pip install --no-cache-dir ecdsa && \ + python setup.py install && \ + make test FROM entrypoint as entrypoint diff --git a/src/main/resources/images/wolfssl/Dockerfile-2_x b/src/main/resources/images/wolfssl/Dockerfile-2_x index f36c7e8..5b4174b 100644 --- a/src/main/resources/images/wolfssl/Dockerfile-2_x +++ b/src/main/resources/images/wolfssl/Dockerfile-2_x @@ -2,22 +2,21 @@ FROM alpine-build:3.6 as wolfssl-base1 ARG VERSION RUN git clone --depth=1 --branch=v2.${VERSION} https://github.com/wolfSSL/wolfssl WORKDIR wolfssl -RUN ./autogen.sh -RUN ./configure --prefix=/build/ +RUN ./autogen.sh && \ + ./configure --prefix=/build/ #remove error flags: some wolfssl version do not compile because tab warnings are treated like errors -RUN mv Makefile tmp && sed "s/-Werror//g" tmp > Makefile -RUN mv Makefile tmp && sed "s/-Wall//g" tmp > Makefile -RUN ( make &&\ - make install) +RUN sed -i -e "s/-Werror//g" -e "s/-Wall//g" Makefile && \ + make -j"$(nproc)" && \ + make install WORKDIR /src/wolfssl/examples/server #this script is a shell script, which creates (links) the lt-server executable on the fly #we need this to copy is later to the execution container -RUN /src/wolfssl/examples/server/server -h -RUN /src/wolfssl/examples/client/client -h +RUN /src/wolfssl/examples/server/server -h && \ + /src/wolfssl/examples/client/client -h # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as wolfssl-base2 COPY --from=wolfssl-base1 /build/include/ /artifacts/ssllib/include/ diff --git a/src/main/resources/images/wolfssl/Dockerfile-3_0-2 b/src/main/resources/images/wolfssl/Dockerfile-3_0-2 index 9a594b9..8109800 100644 --- a/src/main/resources/images/wolfssl/Dockerfile-3_0-2 +++ b/src/main/resources/images/wolfssl/Dockerfile-3_0-2 @@ -2,22 +2,21 @@ FROM alpine-build:3.6 as wolfssl-base1 ARG VERSION RUN git clone --depth=1 --branch=v3.${VERSION} https://github.com/wolfSSL/wolfssl WORKDIR wolfssl -RUN ./autogen.sh -RUN ./configure --prefix=/build/ +RUN ./autogen.sh && \ + ./configure --prefix=/build/ #remove error flags: some wolfssl version do not compile because tab warnings are treated like errors -RUN mv Makefile tmp && sed "s/-Werror//g" tmp > Makefile -RUN mv Makefile tmp && sed "s/-Wall//g" tmp > Makefile -RUN ( make &&\ - make install) +RUN sed -i -e "s/-Werror//g" -e "s/-Wall//g" Makefile && \ + make -j"$(nproc)" && \ + make install WORKDIR /src/wolfssl/examples/server #this script is a shell script, which creates (links) the lt-server executable on the fly #we need this to copy is later to the execution container -RUN /src/wolfssl/examples/server/server -h -RUN /src/wolfssl/examples/client/client -h +RUN /src/wolfssl/examples/server/server -h && \ + /src/wolfssl/examples/client/client -h # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as wolfssl-base2 COPY --from=wolfssl-base1 /build/include/ /artifacts/ssllib/include/ diff --git a/src/main/resources/images/wolfssl/Dockerfile-3_3-x b/src/main/resources/images/wolfssl/Dockerfile-3_3-x index 9fea431..6822115 100644 --- a/src/main/resources/images/wolfssl/Dockerfile-3_3-x +++ b/src/main/resources/images/wolfssl/Dockerfile-3_3-x @@ -7,22 +7,21 @@ RUN sed -i 's/-days 1000/-days 100000/g' renewcerts.sh && \ sed -i 's/default_days.*/default_days = 100000/g' renewcerts/wolfssl.cnf && \ ./renewcerts.sh --override-ntru WORKDIR /src/wolfssl -RUN ./autogen.sh -RUN ./configure --prefix=/build/ C_FLAGS="-DWOLFSSL_STATIC_RSA" C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA" +RUN ./autogen.sh && \ + ./configure --prefix=/build/ C_FLAGS="-DWOLFSSL_STATIC_RSA" C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA" # remove error flags: some wolfssl version do not compile because tab warnings are treated like errors -RUN mv Makefile tmp && sed "s/-Werror//g" tmp > Makefile -RUN mv Makefile tmp && sed "s/-Wall//g" tmp > Makefile -RUN ( make &&\ - make install) +RUN sed -i -e "s/-Werror//g" -e "s/-Wall//g" Makefile && \ + make -j"$(nproc)" && \ + make install WORKDIR /src/wolfssl/examples/server # this script is a shell script, which creates (links) the lt-server executable on the fly # we need this to copy is later to the execution container -RUN /src/wolfssl/examples/server/server -h -RUN /src/wolfssl/examples/client/client -h +RUN /src/wolfssl/examples/server/server -h && \ + /src/wolfssl/examples/client/client -h # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as wolfssl-base2 COPY --from=wolfssl-base1 /build/include/ /artifacts/ssllib/include/ diff --git a/src/main/resources/images/wolfssl/Dockerfile-4_and_5_x b/src/main/resources/images/wolfssl/Dockerfile-4_and_5_x index 12062ac..ef775e6 100644 --- a/src/main/resources/images/wolfssl/Dockerfile-4_and_5_x +++ b/src/main/resources/images/wolfssl/Dockerfile-4_and_5_x @@ -7,22 +7,21 @@ RUN sed -i 's/-days 1000/-days 100000/g' renewcerts.sh && \ sed -i 's/default_days.*/default_days = 100000/g' renewcerts/wolfssl.cnf && \ ./renewcerts.sh --override-ntru WORKDIR /src/wolfssl -RUN ./autogen.sh -RUN ./configure --prefix=/build/ C_FLAGS="-DWOLFSSL_STATIC_RSA" C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA" +RUN ./autogen.sh && \ + ./configure --prefix=/build/ C_FLAGS="-DWOLFSSL_STATIC_RSA" C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA" # remove error flags: some wolfssl version do not compile because tab warnings are treated like errors -RUN mv Makefile tmp && sed "s/-Werror//g" tmp > Makefile -RUN mv Makefile tmp && sed "s/-Wall//g" tmp > Makefile -RUN ( make &&\ - make install) +RUN sed -i -e "s/-Werror//g" -e "s/-Wall//g" Makefile && \ + make -j"$(nproc)" && \ + make install WORKDIR /src/wolfssl/examples/server # this script is a shell script, which creates (links) the lt-server executable on the fly # we need this to copy is later to the execution container -RUN /src/wolfssl/examples/server/server -h -RUN /src/wolfssl/examples/client/client -h +RUN /src/wolfssl/examples/server/server -h && \ + /src/wolfssl/examples/client/client -h # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as wolfssl-base2 COPY --from=wolfssl-base1 /build/include/ /artifacts/ssllib/include/ diff --git a/src/main/resources/images/wolfssl/Dockerfile-5_x b/src/main/resources/images/wolfssl/Dockerfile-5_x index 7a7267d..ca92355 100644 --- a/src/main/resources/images/wolfssl/Dockerfile-5_x +++ b/src/main/resources/images/wolfssl/Dockerfile-5_x @@ -2,8 +2,8 @@ FROM alpine-build:3.6 as wolfssl-base1 ARG VERSION RUN git clone --depth=1 --branch=v${VERSION} https://github.com/wolfSSL/wolfssl WORKDIR /src/wolfssl -RUN ./autogen.sh -RUN ./configure --prefix=/build/ C_FLAGS="-DWOLFSSL_STATIC_RSA" C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA" +RUN ./autogen.sh && \ + ./configure --prefix=/build/ C_FLAGS="-DWOLFSSL_STATIC_RSA" C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA" WORKDIR /src/wolfssl/certs # update certificates, otherwise lt-client might fail... @@ -12,19 +12,18 @@ RUN sed -i 's/-days 1000/-days 100000/g' renewcerts.sh && \ ./renewcerts.sh WORKDIR /src/wolfssl # remove error flags: some wolfssl version do not compile because tab warnings are treated like errors -RUN mv Makefile tmp && sed "s/-Werror//g" tmp > Makefile -RUN mv Makefile tmp && sed "s/-Wall//g" tmp > Makefile -RUN ( make &&\ - make install) +RUN sed -i -e "s/-Werror//g" -e "s/-Wall//g" Makefile && \ + make -j"$(nproc)" && \ + make install WORKDIR /src/wolfssl/examples/server # this script is a shell script, which creates (links) the lt-server executable on the fly # we need this to copy is later to the execution container -RUN /src/wolfssl/examples/server/server -h -RUN /src/wolfssl/examples/client/client -h +RUN /src/wolfssl/examples/server/server -h && \ + /src/wolfssl/examples/client/client -h # copy all libs we need -RUN mkdir /libdeps -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ -RUN cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ +RUN mkdir /libdeps && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/server/.libs/lt-server | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ && \ + cp $(LD_LIBRARY_PATH="/src/wolfssl/src/.libs/" ldd /src/wolfssl/examples/client/.libs/lt-client | awk '$3=="" {print $1}; $3!="" {print $3}') /libdeps/ FROM entrypoint as wolfssl-base2 COPY --from=wolfssl-base1 /build/include/ /artifacts/ssllib/include/ diff --git a/src/main/resources/images/wolfssl_py/Dockerfile b/src/main/resources/images/wolfssl_py/Dockerfile index c5166e3..a9b5844 100644 --- a/src/main/resources/images/wolfssl_py/Dockerfile +++ b/src/main/resources/images/wolfssl_py/Dockerfile @@ -3,10 +3,11 @@ ARG VERSION RUN apk add --no-cache py-setuptools python-dev py-pip py-cffi python2-dev RUN git clone --depth=1 --branch=${VERSION} https://github.com/wolfssl/wolfssl-py WORKDIR wolfssl-py -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN python get-pip.py -RUN pip install pip==9.0.3 -RUN python setup.py build && python setup.py install +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python get-pip.py --no-cache-dir && \ + rm get-pip.py && \ + pip install --no-cache-dir pip==9.0.3 && \ + python setup.py build && python setup.py install FROM entrypoint as entrypoint @@ -17,8 +18,7 @@ LABEL "tls_implementation_version"="${VERSION}" LABEL "tls_implementation_connectionRole"="server" COPY --from=wolfssl-py /src/wolfssl-py/certs/* /src/ COPY --from=wolfssl-py /src/wolfssl-py/examples/server.py /src/ -COPY --from=wolfssl-py /usr/lib/python2.7/site-packages/*.egg /usr/local/lib/python2.7/site-packages/ -COPY --from=wolfssl-py /usr/lib/python2.7/site-packages/_cffi_backend.so /usr/local/lib/python2.7/site-packages/ +COPY --from=wolfssl-py /usr/lib/python2.7/site-packages/*.egg /usr/lib/python2.7/site-packages/_cffi_backend.so /usr/local/lib/python2.7/site-packages/ COPY --from=wolfssl-py /usr/lib/python2.7/site-packages/cffi/ /usr/local/lib/python2.7/site-packages/cffi/ COPY --from=wolfssl-py /usr/lib/libffi* /usr/local/lib/ COPY --from=entrypoint /bin/server-entrypoint /usr/local/bin/ diff --git a/src/main/resources/images/wolfssl_py/Dockerfile_old b/src/main/resources/images/wolfssl_py/Dockerfile_old index 2066758..da0ed6e 100644 --- a/src/main/resources/images/wolfssl_py/Dockerfile_old +++ b/src/main/resources/images/wolfssl_py/Dockerfile_old @@ -3,9 +3,10 @@ ARG VERSION RUN apk add --no-cache py-setuptools python-dev py-pip py-cffi python-dev RUN git clone --depth=1 --branch=${VERSION} https://github.com/wolfssl/wolfssl-py WORKDIR wolfssl-py -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -RUN python get-pip.py -RUN pip install pip==9.0.3 +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python get-pip.py --no-cache-dir && \ + rm get-pip.py && \ + pip install --no-cache-dir pip==9.0.3 RUN python setup.py build && python setup.py install WORKDIR examples #RUN python server.py -c ../certs/server-cert.pem -k ../certs/server-key.pem -p 4433 -A ../certs/ca-digicert-ev.pem -v 3 -b