Skip to content

Commit 24d61a3

Browse files
authored
Merge pull request #49 from felixbuenemann/update-base-image
chore(rootfs): update to hephy/base:v0.4.1 image
2 parents 37e6eee + 8338d41 commit 24d61a3

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

rootfs/Dockerfile

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM hephy/base:v0.4.0 as modsecurity
1+
FROM hephy/base:v0.4.1 as modsecurity
22

33
COPY /bin /bin
44
WORKDIR /tmp/build
@@ -30,35 +30,48 @@ RUN set -x && \
3030
unicode.mapping \
3131
modsecurity.conf-recommended
3232

33-
FROM hephy/base:v0.4.0 as openssl
33+
FROM hephy/base:v0.4.1 as openssl
3434

3535
COPY /bin /bin
3636
WORKDIR /tmp/build
3737

3838
RUN set -x && \
3939
apt-get update && \
4040
apt-get install -y --no-install-recommends \
41-
g++ make patch perl
41+
build-essential fakeroot software-properties-common devscripts
4242

4343
RUN set -x && \
44-
export OPENSSL_VERSION=1.1.1g OPENSSL_SIGNING_KEY=0E604491 BUILD_PATH=$PWD PREFIX=/usr/local && \
45-
get_src_gpg $OPENSSL_SIGNING_KEY "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" && \
44+
export OPENSSL_VERSION=1.1.1g BUILD_PATH=$PWD DEBEMAIL="Team Hephy <team@teamhephy.com>" && \
45+
add-apt-repository --enable-source ppa:ondrej/nginx && \
46+
apt-get build-dep -y openssl=$OPENSSL_VERSION && \
47+
apt-get source -y openssl=$OPENSSL_VERSION && \
4648
# ChaCha20-Poly1305 Draft Support for older Android versions
4749
get_src_file 5e082d46544915b0a580fe71a5e53cb22f535c7dc67a35221d292316701dc085 \
4850
https://raw.githubusercontent.com/hakasenyang/openssl-patch/3ea9038/openssl-1.1.1f-chacha_draft.patch && \
4951
# Allow setting equal preference and TLSv1.3 ciphers in NGINX
5052
get_src_file 04f682c36405a908247c27e317fb0f5f5bb19cbac9699f5afa21fd81511e6be2 \
5153
https://raw.githubusercontent.com/hakasenyang/openssl-patch/e3bd4a8/openssl-equal-1.1.1e-dev_ciphers.patch && \
5254
cd "$BUILD_PATH/openssl-$OPENSSL_VERSION" && \
53-
patch -p1 -i "$BUILD_PATH/openssl-1.1.1f-chacha_draft.patch" && \
54-
patch -p1 -i "$BUILD_PATH/openssl-equal-1.1.1e-dev_ciphers.patch" && \
55-
./config --prefix=/usr/local \
56-
--openssldir=/etc/ssl \
57-
shared enable-weak-ssl-ciphers && \
58-
make -j`nproc` && \
59-
make install_sw
55+
sed -i '/^CONFARGS\s*=/ s/ enable-unit-test//' debian/rules && \
56+
dch -l hephy "Disable unit tests" && \
57+
sed -i '/^CONFARGS\s*=/ s/$/ enable-weak-ssl-ciphers/' debian/rules && \
58+
dch -l hephy "Enable weak SSL ciphers" && \
59+
cp "$BUILD_PATH/openssl-equal-1.1.1e-dev_ciphers.patch" debian/patches/ && \
60+
echo openssl-equal-1.1.1e-dev_ciphers.patch >> debian/patches/series && \
61+
dch -l hephy "Add BoringSSL port of equal preference cipher groups" && \
62+
cp "$BUILD_PATH/openssl-1.1.1f-chacha_draft.patch" debian/patches/ && \
63+
echo openssl-1.1.1f-chacha_draft.patch >> debian/patches/series && \
64+
# Add missing libcrypto 1.1.1f symbol mapping
65+
sed -i '/^ \*@OPENSSL_1_1_1e 1\.1\.1e/p; s/e/f/g' debian/libssl1.1.symbols && \
66+
dch -l hephy "Add ChaCha-Draft cipher support" && \
67+
dch -r " " && \
68+
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -uc -b -rfakeroot && \
69+
cd .. && \
70+
dpkg-scanpackages . > Packages && \
71+
mkdir ../repo && \
72+
mv Packages *.deb ../repo
6073

61-
FROM hephy/base:v0.4.0
74+
FROM hephy/base:v0.4.1
6275

6376
RUN adduser --system \
6477
--shell /bin/bash \
@@ -68,30 +81,25 @@ RUN adduser --system \
6881
router
6982

7083
COPY --from=modsecurity /usr/local /usr/local
71-
COPY --from=openssl /usr/local /usr/local
84+
COPY --from=openssl /tmp/repo /usr/local/repo
7285

7386
COPY /bin /bin
7487

7588
RUN set -x && \
76-
buildDeps='gcc make patch libgeoip-dev libmaxminddb-dev libpcre3-dev' \
77-
runtimeDeps='ca-certificates libcurl3 libxml2 libpcre3 libgeoip1 libmaxminddb0 libfuzzy2' && \
89+
buildDeps='gcc make patch libgeoip-dev libmaxminddb-dev libpcre3-dev libssl-dev' \
90+
runtimeDeps='ca-certificates libcurl4 libxml2 libpcre3 libgeoip1 libmaxminddb0 libfuzzy2 libssl1.1 openssl' && \
91+
echo 'deb [trusted=yes] file:/usr/local/repo ./' >> /etc/apt/sources.list && \
7892
apt-get update && \
7993
apt-get install -y --no-install-recommends \
8094
$buildDeps \
8195
$runtimeDeps && \
82-
# Remove openssl binaries from base image, will be provided by our custom build
83-
apt-get remove -y openssl && \
84-
export NGINX_VERSION=1.18.0 SIGNING_KEY=A1C052F8 \
96+
export NGINX_VERSION=1.18.0 SIGNING_KEY=B0F4253373F8F6F510D42178520A9993A1C052F8 \
8597
CLOUDFLARE_ZLIB_VERSION=372bcd151c901418c2721232bf09dc9cdbebafb5 \
8698
VTS_VERSION=0.1.18 GEOIP2_VERSION=3.3 \
8799
MOD_SECURITY_NGINX_VERSION=e50e43ee4cc87565922ed98b1b6c72751019c326 \
88100
OWASP_MOD_SECURITY_CRS_VERSION=cf57fd53de06b87b90d2cc5d61d602df81b2dd70 \
89101
BUILD_PATH=/tmp/build PREFIX=/opt/router && \
90102
ldconfig && \
91-
# Provide custom openssl binaries in standard /usr/bin location
92-
update-alternatives --verbose \
93-
--install /usr/bin/openssl openssl /usr/local/bin/openssl 1 \
94-
--slave /usr/bin/c_rehash c_rehash /usr/local/bin/c_rehash && \
95103
rm -rf "$PREFIX" && \
96104
mkdir "$PREFIX" && \
97105
mkdir "$BUILD_PATH" && \

0 commit comments

Comments
 (0)