Skip to content

Commit 5c89a5b

Browse files
committed
Adds cert-prune for certbot image
see: https://github.com/axllent/cert-prune
1 parent a2fb6a5 commit 5c89a5b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

docker/Dockerfile.certbot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ LABEL maintainer="Jamie Curnow <[email protected]>"
5151
ARG TARGETPLATFORM
5252
RUN echo "Certbot: nginxproxymanager/nginx-full:${BASE_TAG:-latest}, ${TARGETPLATFORM:-linux/amd64}" >> /built-for-arch
5353

54+
COPY scripts/install-cert-prune /tmp/install-cert-prune
55+
RUN /tmp/install-cert-prune "${TARGETPLATFORM:-linux/amd64}" && rm -f /tmp/install-cert-prune
56+
5457
# OpenResty uses LuaJIT which has a dependency on GCC
5558
RUN apt-get update \
5659
&& apt-get install -y --no-install-recommends \

scripts/install-cert-prune

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash -e
2+
3+
# Note: This script is designed to be run inside a Docker Build for a container
4+
5+
CYAN='\E[1;36m'
6+
YELLOW='\E[1;33m'
7+
BLUE='\E[1;34m'
8+
GREEN='\E[1;32m'
9+
RESET='\E[0m'
10+
11+
CERT_PRUNE_VERSION=0.0.1
12+
TARGETPLATFORM=$1
13+
14+
# Determine the correct binary file for the architecture given
15+
case $TARGETPLATFORM in
16+
linux/arm64)
17+
ARCH=arm64
18+
;;
19+
20+
linux/arm/v7)
21+
ARCH=arm
22+
;;
23+
24+
*)
25+
ARCH=amd64
26+
;;
27+
esac
28+
29+
echo -e "${BLUE}${CYAN}Installing cert-prune v${CERT_PRUNE_VERSION} for ${YELLOW}${TARGETPLATFORM} (${ARCH})${RESET}"
30+
31+
mkdir -p /tmp/cert-prune
32+
cd /tmp/cert-prune
33+
curl -L -o 'cert-prune.tar.gz' "https://github.com/axllent/cert-prune/releases/download/${CERT_PRUNE_VERSION}/cert-prune-linux-${ARCH}.tar.gz"
34+
tar -xzf 'cert-prune.tar.gz'
35+
mv cert-prune /bin/
36+
rm -rf /tmp/cert-prune
37+
38+
echo -e "${BLUE}${GREEN}cert-prune install Complete${RESET}"

0 commit comments

Comments
 (0)