Tamarin/hooks/containerbuild/debian/install-letsencrypt-ca

29 lines
925 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
set -e
2021-02-22 15:41:22 +01:00
DESTDIR=/usr/local/share/ca-certificates
UPDATE_CERTS_CMD=update-ca-certificates
CERTS="$(cat <<EOF
https://letsencrypt.org/certs/isrgrootx1.pem
https://letsencrypt.org/certs/isrg-root-x2.pem
https://letsencrypt.org/certs/lets-encrypt-r3.pem
https://letsencrypt.org/certs/lets-encrypt-e1.pem
https://letsencrypt.org/certs/lets-encrypt-r4.pem
https://letsencrypt.org/certs/lets-encrypt-e2.pem
EOF
)"
2021-02-22 15:41:22 +01:00
echo "ENV DEBIAN_FRONTEND=noninteractive" >> Dockerfile
echo "RUN apt-get update && apt-get install --yes --no-install-recommends wget openssl ca-certificates" >> Dockerfile
2021-02-22 15:41:22 +01:00
for cert in $CERTS; do
filename=$(basename "$cert")
echo "RUN wget -O '$DESTDIR/$filename' $cert" >> Dockerfile
2021-02-22 15:41:22 +01:00
echo "RUN openssl x509 -in '$DESTDIR/$filename' -inform PEM -out '$DESTDIR/$filename.crt'" >> Dockerfile
done
2021-02-22 15:41:22 +01:00
echo "RUN $UPDATE_CERTS_CMD" >> Dockerfile
echo "ENV DEBIAN_FRONTEND=" >> Dockerfile