22# Nginx Builder
33# ############
44
5- FROM debian:buster -slim as nginxbuilder
5+ FROM debian:bullseye -slim as nginxbuilder
66
77ARG OPENRESTY_VERSION
88ARG LUA_VERSION
99ARG LUAROCKS_VERSION
10+ ARG OPENSSL_VERSION
1011
1112RUN apt-get update \
1213 && apt-get install -y \
@@ -16,7 +17,7 @@ RUN apt-get update \
1617 libpcre3-dev \
1718 libreadline-dev \
1819 libssl-dev \
19- openssl unzip \
20+ unzip \
2021 wget \
2122 zlib1g-dev \
2223 git
@@ -25,21 +26,23 @@ RUN apt-get update \
2526COPY ./scripts/build-lua /tmp/build-lua
2627RUN /tmp/build-lua
2728
28- # Nginx build
29+ # Build packages
30+ COPY ./scripts/install-openssl /tmp/install-openssl
31+ RUN /tmp/install-openssl
2932COPY ./scripts/build-openresty /tmp/build-openresty
3033RUN /tmp/build-openresty
3134
3235# ############
3336# Final Image
3437# ############
3538
36- FROM debian:buster -slim
39+ FROM debian:bullseye -slim
3740LABEL maintainer="Jamie Curnow <jc@jc21.com>"
3841
3942SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
4043
4144ARG TARGETPLATFORM
42- RUN echo "Base: debian:buster -slim, ${TARGETPLATFORM:-linux/amd64}" > /built-for-arch
45+ RUN echo "Base: debian:bullseye -slim, ${TARGETPLATFORM:-linux/amd64}" > /built-for-arch
4346
4447# OpenResty uses LuaJIT which has a dependency on GCC
4548RUN apt-get update \
@@ -48,11 +51,13 @@ RUN apt-get update \
4851 ca-certificates \
4952 curl \
5053 figlet \
54+ gcc \
5155 jq \
5256 libncurses6 \
5357 libpcre3 \
54- libreadline7 \
55- openssl \
58+ libreadline8 \
59+ libc6-dev \
60+ make \
5661 perl \
5762 tzdata \
5863 unzip \
@@ -66,6 +71,11 @@ RUN apt-get update \
6671
6772COPY ./files/.bashrc /root/.bashrc
6873
74+ # build and install openssl
75+ ARG OPENSSL_VERSION
76+ COPY ./scripts/install-openssl /tmp/install-openssl
77+ RUN /tmp/install-openssl
78+
6979# Copy lua and luarocks builds from first image
7080COPY --from=nginxbuilder /tmp/lua /tmp/lua
7181COPY --from=nginxbuilder /tmp/luarocks /tmp/luarocks
@@ -80,16 +90,17 @@ COPY ./scripts/install-crowdsec_openresty_bouncer /tmp/install-crowdsec_openrest
8090
8191ARG OPENRESTY_VERSION
8292ARG CROWDSEC_OPENRESTY_BOUNCER_VERSION
93+
8394ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
8495 OPENRESTY_VERSION=${OPENRESTY_VERSION} \
96+ OPENSSL_VERSION=${OPENSSL_VERSION} \
8597 CROWDSEC_OPENRESTY_BOUNCER_VERSION=${CROWDSEC_OPENRESTY_BOUNCER_VERSION}
8698
8799# Install openresty, lua, then clean up file system
88100RUN apt-get update \
89- && apt-get install -y gcc make socat git \
90101 && /tmp/install-lua \
91102 && /tmp/install-openresty \
92- && apt-get remove -y make gcc git wget gettext \
103+ && apt-get remove -y make gcc git wget gettext libc6-dev \
93104 && apt-get autoremove -y \
94105 && apt-get clean \
95106 && rm -rf /var/lib/apt/lists/* \
0 commit comments