Skip to content

Commit 8da6844

Browse files
committed
Install and build openssl
Updated golang to 1.19.7
1 parent c0d90f6 commit 8da6844

File tree

9 files changed

+102
-68
lines changed

9 files changed

+102
-68
lines changed

.jenkins/Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pipeline {
1919
CROWDSEC_OPENRESTY_BOUNCER_VERSION = '0.1.7'
2020
LUA_VERSION = '5.1.5'
2121
LUAROCKS_VERSION = '3.3.1'
22+
OPENSSL_VERSION = '1.1.1t'
2223
}
2324
stages {
2425
stage('Environment') {

docker/Dockerfile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
# Nginx Builder
33
#############
44

5-
FROM debian:buster-slim as nginxbuilder
5+
FROM debian:bullseye-slim as nginxbuilder
66

77
ARG OPENRESTY_VERSION
88
ARG LUA_VERSION
99
ARG LUAROCKS_VERSION
10+
ARG OPENSSL_VERSION
1011

1112
RUN 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 \
2526
COPY ./scripts/build-lua /tmp/build-lua
2627
RUN /tmp/build-lua
2728

28-
# Nginx build
29+
# Build packages
30+
COPY ./scripts/install-openssl /tmp/install-openssl
31+
RUN /tmp/install-openssl
2932
COPY ./scripts/build-openresty /tmp/build-openresty
3033
RUN /tmp/build-openresty
3134

3235
#############
3336
# Final Image
3437
#############
3538

36-
FROM debian:buster-slim
39+
FROM debian:bullseye-slim
3740
LABEL maintainer="Jamie Curnow <[email protected]>"
3841

3942
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4043

4144
ARG 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
4548
RUN 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

6772
COPY ./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
7080
COPY --from=nginxbuilder /tmp/lua /tmp/lua
7181
COPY --from=nginxbuilder /tmp/luarocks /tmp/luarocks
@@ -80,16 +90,17 @@ COPY ./scripts/install-crowdsec_openresty_bouncer /tmp/install-crowdsec_openrest
8090

8191
ARG OPENRESTY_VERSION
8292
ARG CROWDSEC_OPENRESTY_BOUNCER_VERSION
93+
8394
ENV 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
88100
RUN 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/* \

docker/Dockerfile.acmesh-golang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.19.6 as go
1+
FROM golang:1.19.7 as go
22
FROM nginxproxymanager/nginx-full:${ACMESH_BASE_TAG:-acmesh}
33
LABEL maintainer="Jamie Curnow <[email protected]>"
44

docker/Dockerfile.certbot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Certbot Builder
33
#############
44

5-
FROM debian:buster-slim as certbotbuilder
5+
FROM debian:bullseye-slim as certbotbuilder
66

77
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
88

local-build.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

scripts/buildx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ docker buildx build \
1919
--platform linux/amd64,linux/arm64,linux/arm/7 \
2020
--progress plain \
2121
--pull \
22+
--no-cache \
2223
--build-arg BASE_TAG \
2324
--build-arg ACMESH_BASE_TAG \
2425
--build-arg CERTBOT_BASE_TAG \
2526
--build-arg OPENRESTY_VERSION \
2627
--build-arg LUA_VERSION \
2728
--build-arg LUAROCKS_VERSION \
2829
--build-arg CROWDSEC_OPENRESTY_BOUNCER_VERSION \
30+
--build-arg OPENSSL_VERSION \
2931
$@ \
3032
.
3133

scripts/install-openssl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash -e
2+
3+
BLUE='\E[1;34m'
4+
CYAN='\E[1;36m'
5+
YELLOW='\E[1;33m'
6+
GREEN='\E[1;32m'
7+
RESET='\E[0m'
8+
9+
echo -e "${BLUE}${CYAN}Building and installing openssl ${YELLOW}${OPENSSL_VERSION}...${RESET}"
10+
11+
# remove previously installed openssl
12+
if test -f "/usr/bin/openssl"; then
13+
apt-get update
14+
apt-get remove -y opensssl || true
15+
apt-get clean
16+
rm -rf /var/lib/apt/lists/* /var/cache/*
17+
fi
18+
19+
cd /tmp
20+
wget "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
21+
tar -xzf "openssl-${OPENSSL_VERSION}.tar.gz"
22+
mv "/tmp/openssl-${OPENSSL_VERSION}" /tmp/openssl
23+
cd /tmp/openssl
24+
25+
./config
26+
make test
27+
make install
28+
rm -rf /usr/bin/openssl
29+
ln -s /usr/local/bin/openssl /usr/bin/openssl
30+
ldconfig
31+
32+
cd /tmp
33+
rm -rf /tmp/openssl /usr/local/share/docker/openssl
34+
35+
echo -e "${BLUE}${GREEN}openssl install completed: ${YELLOW}$(openssl version)${RESET}"

scripts/localbuild

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash -e
2+
3+
BLUE='\E[1;34m'
4+
GREEN='\E[1;32m'
5+
RESET='\E[0m'
6+
7+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
cd "${DIR}/.."
9+
10+
export BASE_TAG=latest
11+
export OPENRESTY_VERSION=1.19.3.1
12+
export LUA_VERSION=5.1.5
13+
export LUAROCKS_VERSION=3.3.1
14+
export OPENSSL_VERSION=1.1.1t
15+
16+
docker build \
17+
--pull \
18+
--no-cache \
19+
--build-arg BASE_TAG \
20+
--build-arg OPENRESTY_VERSION \
21+
--build-arg LUA_VERSION \
22+
--build-arg LUAROCKS_VERSION \
23+
--build-arg OPENSSL_VERSION \
24+
-t nginx-full:dev \
25+
-f docker/Dockerfile \
26+
.
27+
28+
echo -e "${BLUE}${GREEN}Build Complete${RESET}"

scripts/localbuildx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash -e
2+
3+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
cd "${DIR}/.."
5+
6+
export IMAGE=nginx-full
7+
export BASE_TAG=latest
8+
export OPENRESTY_VERSION=1.19.3.1
9+
export LUA_VERSION=5.1.5
10+
export LUAROCKS_VERSION=3.3.1
11+
export OPENSSL_VERSION=1.1.1t
12+
13+
#./scripts/buildx --push -f docker/Dockerfile -t docker.io/nginxproxymanager/${IMAGE}:${BASE_TAG}
14+
./scripts/buildx --push -f docker/Dockerfile -t docker.io/nginxproxymanager/${IMAGE}:latest

0 commit comments

Comments
 (0)