Skip to content

Commit 49054c9

Browse files
committed
Add support for mod_http2 mod_lua mod_proxy_html mod_xml2enc
1 parent 89a75f8 commit 49054c9

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

2.4/Dockerfile

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ RUN mkdir -p "$HTTPD_PREFIX" \
99
&& chown www-data:www-data "$HTTPD_PREFIX"
1010
WORKDIR $HTTPD_PREFIX
1111

12+
# library for mod_http2
13+
ENV NGHTTP2_VERSION 1.16.0-1
14+
RUN { \
15+
echo 'deb http://deb.debian.org/debian stretch main'; \
16+
} > /etc/apt/sources.list.d/stretch.list \
17+
&& { \
18+
# add a negative "Pin-Priority" so that we never ever get packages from stretch unless we explicitly request them
19+
echo 'Package: *'; \
20+
echo 'Pin: release n=stretch'; \
21+
echo 'Pin-Priority: -10'; \
22+
echo; \
23+
# except nghttp2, which is the reason we're here
24+
echo 'Package: libnghttp2*'; \
25+
echo "Pin: version $NGHTTP2_VERSION"; \
26+
echo 'Pin-Priority: 990'; \
27+
echo; \
28+
} > /etc/apt/preferences.d/unstable-nghttp2
29+
1230
# install httpd runtime dependencies
1331
# https://httpd.apache.org/docs/2.4/install.html#requirements
1432
RUN apt-get update \
@@ -18,8 +36,11 @@ RUN apt-get update \
1836
libaprutil1-ldap \
1937
libapr1-dev \
2038
libaprutil1-dev \
39+
liblua5.2-0 \
40+
libnghttp2-14=$NGHTTP2_VERSION \
2141
libpcre++0 \
2242
libssl1.0.0 \
43+
libxml2 \
2344
&& rm -r /var/lib/apt/lists/*
2445

2546
ENV HTTPD_VERSION 2.4.23
@@ -32,17 +53,23 @@ ENV HTTPD_ASC_URL https://www.apache.org/dist/httpd/httpd-$HTTPD_VERSION.tar.bz2
3253

3354
# see https://httpd.apache.org/docs/2.4/install.html#requirements
3455
RUN set -x \
35-
&& buildDeps=' \
56+
# mod_http2 mod_lua mod_proxy_html mod_xml2enc
57+
# https://anonscm.debian.org/cgit/pkg-apache/apache2.git/tree/debian/control?id=adb6f181257af28ee67af15fc49d2699a0080d4c
58+
&& buildDeps=" \
3659
bzip2 \
3760
ca-certificates \
3861
gcc \
62+
libnghttp2-dev=$NGHTTP2_VERSION \
63+
liblua5.2-dev \
3964
libpcre++-dev \
4065
libssl-dev \
66+
libxml2-dev \
67+
zlib1g-dev \
4168
make \
4269
wget \
43-
' \
70+
" \
4471
&& apt-get update \
45-
&& apt-get install -y --no-install-recommends $buildDeps \
72+
&& apt-get install -y --no-install-recommends -V $buildDeps \
4673
&& rm -r /var/lib/apt/lists/* \
4774
\
4875
&& wget -O httpd.tar.bz2 "$HTTPD_BZ2_URL" \
@@ -55,7 +82,7 @@ RUN set -x \
5582
&& rm -r "$GNUPGHOME" httpd.tar.bz2.asc \
5683
\
5784
&& mkdir -p src \
58-
&& tar -xvf httpd.tar.bz2 -C src --strip-components=1 \
85+
&& tar -xf httpd.tar.bz2 -C src --strip-components=1 \
5986
&& rm httpd.tar.bz2 \
6087
&& cd src \
6188
\

2.4/alpine/Dockerfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,21 @@ RUN set -x \
3636
gcc \
3737
gnupg \
3838
libc-dev \
39+
# mod_proxy_html mod_xml2enc
40+
libxml2-dev \
41+
# mod_lua
42+
lua-dev \
3943
make \
44+
# no mod_session_crypto: openssl-dev in alpine doesn't work, but libressl is edge only (and brings conflicts with edge packages)
4045
openssl \
4146
openssl-dev \
4247
pcre-dev \
4348
tar \
49+
zlib-dev \
50+
# https://bugs.alpinelinux.org/issues/6375
51+
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \
52+
# mod_http2
53+
&& apk add --no-cache nghttp2-dev@edge \
4454
\
4555
&& wget -O httpd.tar.bz2 "$HTTPD_BZ2_URL" \
4656
&& echo "$HTTPD_SHA1 *httpd.tar.bz2" | sha1sum -c - \
@@ -52,7 +62,7 @@ RUN set -x \
5262
&& rm -r "$GNUPGHOME" httpd.tar.bz2.asc \
5363
\
5464
&& mkdir -p src \
55-
&& tar -xvf httpd.tar.bz2 -C src --strip-components=1 \
65+
&& tar -xf httpd.tar.bz2 -C src --strip-components=1 \
5666
&& rm httpd.tar.bz2 \
5767
&& cd src \
5868
\
@@ -77,8 +87,11 @@ RUN set -x \
7787
| xargs -r apk info --installed \
7888
| sort -u \
7989
)" \
90+
# `apk update` instead of --no-cache since `apk del` gets confused with `@edge` packages if there is no cache
91+
&& apk update \
8092
&& apk add --virtual .httpd-rundeps $runDeps \
81-
&& apk del .build-deps
93+
&& apk del .build-deps \
94+
&& rm -rf /var/cache/apk/*
8295

8396
COPY httpd-foreground /usr/local/bin/
8497

update.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if [ ${#versions[@]} -eq 0 ]; then
99
fi
1010
versions=( "${versions[@]%/}" )
1111

12+
nghttp2VersionDebian="$(docker run -i --rm debian:stretch-slim bash -c 'apt-get update -qq && apt-cache show "$@"' -- "libnghttp2-dev" |tac|tac| awk -F ': ' '$1 == "Version" { print $2; exit }')"
1213

1314
travisEnv=
1415
for version in "${versions[@]}"; do
@@ -19,6 +20,7 @@ for version in "${versions[@]}"; do
1920
sed -ri \
2021
-e 's/^(ENV HTTPD_VERSION) .*/\1 '"$fullVersion"'/' \
2122
-e 's/^(ENV HTTPD_SHA1) .*/\1 '"$sha1"'/' \
23+
-e 's/^(ENV NGHTTP2_VERSION) .*/\1 '"$nghttp2VersionDebian"'/' \
2224
"$version/Dockerfile" "$version"/*/Dockerfile
2325
)
2426

0 commit comments

Comments
 (0)