Skip to content

Commit 025c0bb

Browse files
committed
Fix cert creation image
Now using alpine. Debian stretch is not supported anymore (apt udpate failed). Newer versions eem to not ship openjdk8 by default, but you have to add a custom repo Alpine seems easier and should hopefully be easier to update.
1 parent f70d5d8 commit 025c0bb

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

certs/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
FROM debian:stretch
1+
FROM alpine:3.18
22

3-
RUN apt-get update
4-
RUN apt-get install software-properties-common -y
5-
RUN apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
6-
RUN apt-get update && apt-get install -y \
3+
RUN apk add \
74
openssl \
8-
libnss3-tools \
9-
openjdk-8-jdk \
10-
curl
5+
nss-tools \
6+
openjdk8 \
7+
curl \
8+
&& apk cache clean
119

1210
WORKDIR /certs
1311
COPY generateCerts.sh cert.cfg /run/

certs/generateCerts.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
set -eu
33

44
WARN='\033[0;31m'
@@ -39,5 +39,6 @@ pk12util -i ec256.p12 -d db -K password -W password
3939
echo "Creating Java keystore"
4040
keytool -importkeystore -srckeystore rsa2048.p12 -srcstoretype pkcs12 -destkeystore keys.jks -deststoretype jks -alias cert -destalias rsa2048 -srcstorepass password -deststorepass password
4141
keytool -importkeystore -srckeystore ec256.p12 -srcstoretype pkcs12 -destkeystore keys.jks -deststoretype jks -alias cert -destalias ec256 -srcstorepass password -deststorepass password
42-
#use test-ca from rustls
43-
curl -L https://github.com/ctz/rustls/tarball/master | tar zx --wildcards --strip-components=1 '*/test-ca/'
42+
# fetch test-ca from rustls, used for LIBRESSL
43+
# alpine tar does not have a --wildcards flag. Nonetheless it still extracts correctly but with an error - so use ls to check if it was extracted correctly
44+
curl -L https://github.com/ctz/rustls/tarball/master | tar x -z --strip-components=1 '*/test-ca/' || ls test-ca/rsa/end.rsa test-ca/rsa/end.fullchain

certs/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash -e
22
cd "$(dirname "$0")" || exit 1
33
set -eu
44

setup.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/bin/bash
2-
cd certs
1+
#!/bin/bash -e
2+
cd "$(dirname "$0")" || exit 1
3+
34
echo "[+] Generate certificates"
4-
./setup.sh
5-
cd ..
5+
./certs/setup.sh
66

77
echo "[+] Build base image"
88
./images/baseimage/build-base.sh
99

1010
echo " "
1111
echo "To build every available docker image, or every docker image of a specific TLS Libraries, use the 'build-everything.py' script (requires python >=3.7)"
12-
echo "To build only specific TLS Libraries, use the 'build.sh' scripts inside the subfolders of 'images/'."
12+
echo "To build only specific TLS Libraries, use the 'build.sh' scripts inside the subfolders of 'images/'."

0 commit comments

Comments
 (0)