mirror of
https://github.com/NginxProxyManager/docker-nginx-full.git
synced 2024-12-06 19:26:20 +01:00
Restructured docker images heirarchy
This commit is contained in:
+13
-75
@@ -1,45 +1,3 @@
|
||||
#############
|
||||
# Certbot Builder
|
||||
#############
|
||||
|
||||
FROM debian:buster-slim as certbotbuilder
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
libaugeas0 \
|
||||
python3 \
|
||||
python3-dev \
|
||||
libffi-dev \
|
||||
libssl-dev \
|
||||
python3-venv \
|
||||
ca-certificates
|
||||
|
||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
# Yes, python compilation requires rust.
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
ENV PATH="/root/.cargo/bin:$PATH"
|
||||
|
||||
# It's all about pip now.
|
||||
RUN python3 -m venv /opt/certbot/
|
||||
ENV PATH="/opt/certbot/bin:$PATH"
|
||||
|
||||
RUN curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3
|
||||
|
||||
# Handle an extremely specific issue when building the cryptography package for
|
||||
# 32-bit architectures within QEMU running on a 64-bit host
|
||||
# Special thanks to https://github.com/JonasAlfredsson/docker-nginx-certbot
|
||||
RUN if [ "$(getconf LONG_BIT)" = "32" ]; then \
|
||||
pip3 install --no-cache-dir -U cryptography==3.3.2; \
|
||||
fi
|
||||
|
||||
RUN pip install --no-cache-dir cffi certbot \
|
||||
&& pip install tldextract
|
||||
|
||||
#############
|
||||
# Nginx Builder
|
||||
#############
|
||||
@@ -83,26 +41,25 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
ARG TARGETPLATFORM
|
||||
RUN echo "Base: debian:buster-slim, ${TARGETPLATFORM:-linux/amd64}" > /built-for-arch
|
||||
|
||||
# OpenResty uses LuaJIT which has a dependency on GCC
|
||||
# OpenResty uses LuaJIT which has a dependency on GCC
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
apache2-utils \
|
||||
ca-certificates \
|
||||
curl \
|
||||
figlet \
|
||||
jq \
|
||||
libncurses6 \
|
||||
libpcre3 \
|
||||
libreadline7 \
|
||||
openssl \
|
||||
perl \
|
||||
python3 \
|
||||
python3-distutils \
|
||||
python3-venv \
|
||||
tzdata \
|
||||
unzip \
|
||||
zlib1g \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /var/cache/* /var/log/* /tmp/* /var/lib/dpkg/status-old
|
||||
|
||||
COPY ./files/.bashrc /root/.bashrc
|
||||
|
||||
@@ -115,44 +72,25 @@ COPY ./scripts/install-lua /tmp/install-lua
|
||||
COPY --from=nginxbuilder /tmp/openresty /tmp/openresty
|
||||
COPY ./scripts/install-openresty /tmp/install-openresty
|
||||
|
||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
# Copy certbot
|
||||
COPY --from=certbotbuilder /opt/certbot /opt/certbot
|
||||
RUN curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3 \
|
||||
&& python3 -m venv /opt/certbot/ \
|
||||
&& ln -s /opt/certbot/bin/certbot /usr/bin/certbot
|
||||
|
||||
ARG OPENRESTY_VERSION
|
||||
ENV OPENRESTY_VERSION=${OPENRESTY_VERSION} \
|
||||
CERT_HOME='/data/acme.sh/' \
|
||||
PATH="/opt/certbot/bin:$PATH"
|
||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
|
||||
OPENRESTY_VERSION=${OPENRESTY_VERSION}
|
||||
|
||||
# Install openresty, lua
|
||||
# Install openresty, lua, then clean up file system
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
gcc \
|
||||
make \
|
||||
socat \
|
||||
git \
|
||||
&& apt-get install -y gcc make socat git \
|
||||
&& /tmp/install-lua \
|
||||
&& /tmp/install-openresty \
|
||||
&& rm -f /tmp/install-lua \
|
||||
&& rm -f /tmp/install-openresty \
|
||||
&& apt-get remove -y make gcc git \
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# acme.sh
|
||||
RUN mkdir -p /data/acme.sh \
|
||||
&& curl -o /bin/acme.sh 'https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh' \
|
||||
&& chmod +x /bin/acme.sh
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /var/cache/* /var/log/* /tmp/* /var/lib/dpkg/status-old
|
||||
|
||||
LABEL org.label-schema.schema-version="1.0" \
|
||||
org.label-schema.license="MIT" \
|
||||
org.label-schema.name="nginx-full" \
|
||||
org.label-schema.description="A base image for use by Nginx Proxy Manager" \
|
||||
org.label-schema.url="https://github.com/jc21/docker-nginx-full" \
|
||||
org.label-schema.vcs-url="https://github.com/jc21/docker-nginx-full.git" \
|
||||
org.label-schema.cmd="docker run --rm -ti jc21/nginx-full:latest"
|
||||
org.label-schema.url="https://github.com/nginxproxymanager/docker-nginx-full" \
|
||||
org.label-schema.vcs-url="https://github.com/nginxproxymanager/docker-nginx-full.git" \
|
||||
org.label-schema.cmd="docker run --rm -ti nginxproxymanager/nginx-full:latest"
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
FROM nginxproxymanager/nginx-full:${BASE_TAG:-latest}
|
||||
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
RUN echo "Acme.sh: nginxproxymanager/nginx-full:${BASE_TAG:-latest}, ${TARGETPLATFORM:-linux/amd64}" >> /built-for-arch
|
||||
|
||||
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
# acme.sh
|
||||
RUN mkdir -p /data/acme.sh \
|
||||
&& curl -o /bin/acme.sh 'https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh' \
|
||||
&& chmod +x /bin/acme.sh
|
||||
|
||||
LABEL org.label-schema.cmd="docker run --rm -ti nginxproxymanager/nginx-full:acmesh"
|
||||
@@ -0,0 +1,29 @@
|
||||
FROM golang:latest as go
|
||||
FROM nginxproxymanager/nginx-full:${ACMESH_BASE_TAG:-acmesh}
|
||||
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
RUN echo "Golang: nginxproxymanager/nginx-full:${BASE_TAG:-acmesh}, ${TARGETPLATFORM:-linux/amd64}" >> /built-for-arch
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y wget gcc g++ make git sqlite3 jq \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# copy go from golang
|
||||
COPY --from=go /usr/local/go /usr/local/go
|
||||
|
||||
ENV GOPATH=/opt/go PATH="/usr/local/go/bin:$PATH:/opt/go/bin"
|
||||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" \
|
||||
&& chmod -R 777 "$GOPATH" \
|
||||
&& echo "====> ${TARGETPLATFORM}: $(go version)"
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
# Gotools
|
||||
RUN if [ "$TARGETPLATFORM" == "" ] || [ "$TARGETPLATFORM" == "linux/amd64" ]; then cd /usr && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.39.0; fi
|
||||
RUN go get -u github.com/kyoh86/richgo \
|
||||
&& go get -u github.com/sonatype-nexus-community/nancy \
|
||||
&& rm -rf /root/.cache/go-build
|
||||
|
||||
LABEL org.label-schema.cmd="docker run --rm -ti nginxproxymanager/nginx-full:acmesh-golang"
|
||||
@@ -0,0 +1,68 @@
|
||||
#############
|
||||
# Certbot Builder
|
||||
#############
|
||||
|
||||
FROM debian:buster-slim as certbotbuilder
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
libaugeas0 \
|
||||
python3 \
|
||||
python3-dev \
|
||||
libffi-dev \
|
||||
libssl-dev \
|
||||
python3-venv \
|
||||
ca-certificates
|
||||
|
||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
# Yes, python compilation requires rust.
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
ENV PATH="/root/.cargo/bin:$PATH"
|
||||
|
||||
# It's all about pip now.
|
||||
RUN python3 -m venv /opt/certbot/
|
||||
ENV PATH="/opt/certbot/bin:$PATH"
|
||||
|
||||
RUN curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3
|
||||
|
||||
# Handle an extremely specific issue when building the cryptography package for
|
||||
# 32-bit architectures within QEMU running on a 64-bit host
|
||||
# Special thanks to https://github.com/JonasAlfredsson/docker-nginx-certbot
|
||||
RUN if [ "$(getconf LONG_BIT)" = "32" ]; then \
|
||||
pip3 install --no-cache-dir -U cryptography==3.3.2; \
|
||||
fi
|
||||
|
||||
RUN pip install --no-cache-dir cffi certbot \
|
||||
&& pip install tldextract
|
||||
|
||||
#############
|
||||
# Final Image
|
||||
#############
|
||||
|
||||
FROM nginxproxymanager/nginx-full:${BASE_TAG:-latest}
|
||||
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
RUN echo "Certbot: nginxproxymanager/nginx-full:${BASE_TAG:-latest}, ${TARGETPLATFORM:-linux/amd64}" >> /built-for-arch
|
||||
|
||||
# OpenResty uses LuaJIT which has a dependency on GCC
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
python3 \
|
||||
python3-distutils \
|
||||
python3-venv \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy certbot
|
||||
COPY --from=certbotbuilder /opt/certbot /opt/certbot
|
||||
RUN curl -L 'https://bootstrap.pypa.io/get-pip.py' | python3 \
|
||||
&& python3 -m venv /opt/certbot/ \
|
||||
&& ln -s /opt/certbot/bin/certbot /usr/bin/certbot
|
||||
|
||||
LABEL org.label-schema.cmd="docker run --rm -ti nginxproxymanager/nginx-full:certbot"
|
||||
@@ -1,8 +1,8 @@
|
||||
FROM nginxproxymanager/nginx-full:${BASE_TAG:-latest}
|
||||
FROM nginxproxymanager/nginx-full:${CERTBOT_BASE_TAG:-certbot}
|
||||
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
RUN echo "Node: jc21/nginx-full:${BASE_TAG:-latest}, ${TARGETPLATFORM:-linux/amd64}" >> /built-for-arch
|
||||
RUN echo "Node: nginxproxymanager/nginx-full:${BASE_TAG:-certbot}, ${TARGETPLATFORM:-linux/amd64}" >> /built-for-arch
|
||||
|
||||
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
@@ -17,3 +17,5 @@ RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
|
||||
COPY ./files/test.js /tmp/test.js
|
||||
RUN node /tmp/test.js \
|
||||
&& rm -f /tmp/test.js
|
||||
|
||||
LABEL org.label-schema.cmd="docker run --rm -ti nginxproxymanager/nginx-full:certbot-node"
|
||||
Reference in New Issue
Block a user