Adds cert-prune for certbot image

see:
https://github.com/axllent/cert-prune
This commit is contained in:
Jamie Curnow
2023-03-15 13:52:40 +10:00
parent a2fb6a517f
commit 5c89a5b9fb
2 changed files with 41 additions and 0 deletions
+3
View File
@@ -51,6 +51,9 @@ LABEL maintainer="Jamie Curnow <jc@jc21.com>"
ARG TARGETPLATFORM
RUN echo "Certbot: nginxproxymanager/nginx-full:${BASE_TAG:-latest}, ${TARGETPLATFORM:-linux/amd64}" >> /built-for-arch
COPY scripts/install-cert-prune /tmp/install-cert-prune
RUN /tmp/install-cert-prune "${TARGETPLATFORM:-linux/amd64}" && rm -f /tmp/install-cert-prune
# OpenResty uses LuaJIT which has a dependency on GCC
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash -e
# Note: This script is designed to be run inside a Docker Build for a container
CYAN='\E[1;36m'
YELLOW='\E[1;33m'
BLUE='\E[1;34m'
GREEN='\E[1;32m'
RESET='\E[0m'
CERT_PRUNE_VERSION=0.0.1
TARGETPLATFORM=$1
# Determine the correct binary file for the architecture given
case $TARGETPLATFORM in
linux/arm64)
ARCH=arm64
;;
linux/arm/v7)
ARCH=arm
;;
*)
ARCH=amd64
;;
esac
echo -e "${BLUE}❯ ${CYAN}Installing cert-prune v${CERT_PRUNE_VERSION} for ${YELLOW}${TARGETPLATFORM} (${ARCH})${RESET}"
mkdir -p /tmp/cert-prune
cd /tmp/cert-prune
curl -L -o 'cert-prune.tar.gz' "https://github.com/axllent/cert-prune/releases/download/${CERT_PRUNE_VERSION}/cert-prune-linux-${ARCH}.tar.gz"
tar -xzf 'cert-prune.tar.gz'
mv cert-prune /bin/
rm -rf /tmp/cert-prune
echo -e "${BLUE}❯ ${GREEN}cert-prune install Complete${RESET}"