1- # ############
2- # Certbot Builder
3- # ############
4-
5- FROM debian:buster-slim as certbotbuilder
6-
7- SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
8-
9- RUN apt-get update
10- RUN apt-get install -y \
11- build-essential \
12- curl \
13- libaugeas0 \
14- python3 \
15- python3-dev \
16- libffi-dev \
17- libssl-dev \
18- python3-venv \
19- ca-certificates
20-
21- ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
22-
23- # Yes, python compilation requires rust.
24- RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
25- ENV PATH="/root/.cargo/bin:$PATH"
26-
27- # It's all about pip now.
28- RUN python3 -m venv /opt/certbot/
29- ENV PATH="/opt/certbot/bin:$PATH"
30-
31- RUN curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3
32-
33- # Handle an extremely specific issue when building the cryptography package for
34- # 32-bit architectures within QEMU running on a 64-bit host
35- # Special thanks to https://github.com/JonasAlfredsson/docker-nginx-certbot
36- RUN if [ "$(getconf LONG_BIT)" = "32" ]; then \
37- pip3 install --no-cache-dir -U cryptography==3.3.2; \
38- fi
39-
40- RUN pip install --no-cache-dir cffi certbot \
41- && pip install tldextract
42-
431# ############
442# Nginx Builder
453# ############
@@ -83,26 +41,25 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
8341ARG TARGETPLATFORM
8442RUN echo "Base: debian:buster-slim, ${TARGETPLATFORM:-linux/amd64}" > /built-for-arch
8543
86- # OpenResty uses LuaJIT which has a dependency on GCC
44+ # OpenResty uses LuaJIT which has a dependency on GCC
8745RUN apt-get update \
8846 && apt-get install -y --no-install-recommends \
8947 apache2-utils \
9048 ca-certificates \
9149 curl \
9250 figlet \
51+ jq \
9352 libncurses6 \
9453 libpcre3 \
9554 libreadline7 \
9655 openssl \
9756 perl \
98- python3 \
99- python3-distutils \
100- python3-venv \
10157 tzdata \
10258 unzip \
10359 zlib1g \
10460 && apt-get clean \
105- && rm -rf /var/lib/apt/lists/*
61+ && rm -rf /var/lib/apt/lists/* \
62+ && rm -rf /var/cache/* /var/log/* /tmp/* /var/lib/dpkg/status-old
10663
10764COPY ./files/.bashrc /root/.bashrc
10865
@@ -115,44 +72,25 @@ COPY ./scripts/install-lua /tmp/install-lua
11572COPY --from=nginxbuilder /tmp/openresty /tmp/openresty
11673COPY ./scripts/install-openresty /tmp/install-openresty
11774
118- ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
119-
120- # Copy certbot
121- COPY --from=certbotbuilder /opt/certbot /opt/certbot
122- RUN curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3 \
123- && python3 -m venv /opt/certbot/ \
124- && ln -s /opt/certbot/bin/certbot /usr/bin/certbot
125-
12675ARG OPENRESTY_VERSION
127- ENV OPENRESTY_VERSION=${OPENRESTY_VERSION} \
128- CERT_HOME='/data/acme.sh/' \
129- PATH="/opt/certbot/bin:$PATH"
76+ ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
77+ OPENRESTY_VERSION=${OPENRESTY_VERSION}
13078
131- # Install openresty, lua
79+ # Install openresty, lua, then clean up file system
13280RUN apt-get update \
133- && apt-get install -y \
134- gcc \
135- make \
136- socat \
137- git \
81+ && apt-get install -y gcc make socat git \
13882 && /tmp/install-lua \
13983 && /tmp/install-openresty \
140- && rm -f /tmp/install-lua \
141- && rm -f /tmp/install-openresty \
14284 && apt-get remove -y make gcc git \
14385 && apt-get autoremove -y \
14486 && apt-get clean \
145- && rm -rf /var/lib/apt/lists/*
146-
147- # acme.sh
148- RUN mkdir -p /data/acme.sh \
149- && curl -o /bin/acme.sh 'https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh' \
150- && chmod +x /bin/acme.sh
87+ && rm -rf /var/lib/apt/lists/* \
88+ && rm -rf /var/cache/* /var/log/* /tmp/* /var/lib/dpkg/status-old
15189
15290LABEL org.label-schema.schema-version="1.0" \
15391 org.label-schema.license="MIT" \
15492 org.label-schema.name="nginx-full" \
15593 org.label-schema.description="A base image for use by Nginx Proxy Manager" \
156- org.label-schema.url="https://github.com/jc21 /docker-nginx-full" \
157- org.label-schema.vcs-url="https://github.com/jc21 /docker-nginx-full.git" \
158- org.label-schema.cmd="docker run --rm -ti jc21 /nginx-full:latest"
94+ org.label-schema.url="https://github.com/nginxproxymanager /docker-nginx-full" \
95+ org.label-schema.vcs-url="https://github.com/nginxproxymanager /docker-nginx-full.git" \
96+ org.label-schema.cmd="docker run --rm -ti nginxproxymanager /nginx-full:latest"
0 commit comments