2021-02-18 18:56:45 +01:00
|
|
|
#!/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-18 18:56:45 +01:00
|
|
|
|
|
|
|
|
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 openssl ca-certificates" >> Dockerfile
|
2021-02-18 18:56:45 +01:00
|
|
|
|
2021-02-22 15:41:22 +01:00
|
|
|
for cert in $CERTS; do
|
|
|
|
filename=$(basename "$cert")
|
|
|
|
echo "ADD $cert $DESTDIR/$filename" >> Dockerfile
|
|
|
|
echo "RUN openssl x509 -in '$DESTDIR/$filename' -inform PEM -out '$DESTDIR/$filename.crt'" >> Dockerfile
|
|
|
|
done
|
2021-02-18 18:56:45 +01:00
|
|
|
|
2021-02-22 15:41:22 +01:00
|
|
|
echo "RUN $UPDATE_CERTS_CMD" >> Dockerfile
|
|
|
|
echo "ENV DEBIAN_FRONTEND=" >> Dockerfile
|