Skip to content

Commit

Permalink
Add support for mod_http2
Browse files Browse the repository at this point in the history
  • Loading branch information
yosifkit committed Oct 21, 2016
1 parent 89a75f8 commit 924dbad
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
28 changes: 24 additions & 4 deletions 2.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ RUN mkdir -p "$HTTPD_PREFIX" \
&& chown www-data:www-data "$HTTPD_PREFIX"
WORKDIR $HTTPD_PREFIX

# library for mod_http2
ENV NGHTTP2_VERSION 1.15.0-1
RUN { \
echo 'deb http://deb.debian.org/debian unstable main'; \
} > /etc/apt/sources.list.d/unstable.list \
&& { \
# add a negative "Pin-Priority" so that we never ever get packages from unstable unless we explicitly request them
echo 'Package: *'; \
echo 'Pin: release a=unstable'; \
echo 'Pin-Priority: -10'; \
echo; \
# except nghttp2, which is the reason we're here
echo 'Package: libnghttp2*'; \
echo "Pin: version $NGHTTP2_VERSION"; \
echo 'Pin-Priority: 990'; \
echo; \
} > /etc/apt/preferences.d/unstable-nghttp2

# install httpd runtime dependencies
# https://httpd.apache.org/docs/2.4/install.html#requirements
RUN apt-get update \
Expand All @@ -18,6 +36,7 @@ RUN apt-get update \
libaprutil1-ldap \
libapr1-dev \
libaprutil1-dev \
libnghttp2-14=$NGHTTP2_VERSION \
libpcre++0 \
libssl1.0.0 \
&& rm -r /var/lib/apt/lists/*
Expand All @@ -32,17 +51,18 @@ ENV HTTPD_ASC_URL https://www.apache.org/dist/httpd/httpd-$HTTPD_VERSION.tar.bz2

# see https://httpd.apache.org/docs/2.4/install.html#requirements
RUN set -x \
&& buildDeps=' \
&& buildDeps=" \
bzip2 \
ca-certificates \
gcc \
libnghttp2-dev=$NGHTTP2_VERSION \
libpcre++-dev \
libssl-dev \
make \
wget \
' \
" \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends -V $buildDeps \
&& rm -r /var/lib/apt/lists/* \
\
&& wget -O httpd.tar.bz2 "$HTTPD_BZ2_URL" \
Expand All @@ -55,7 +75,7 @@ RUN set -x \
&& rm -r "$GNUPGHOME" httpd.tar.bz2.asc \
\
&& mkdir -p src \
&& tar -xvf httpd.tar.bz2 -C src --strip-components=1 \
&& tar -xf httpd.tar.bz2 -C src --strip-components=1 \
&& rm httpd.tar.bz2 \
&& cd src \
\
Expand Down
8 changes: 7 additions & 1 deletion 2.4/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ RUN set -x \
openssl-dev \
pcre-dev \
tar \
# https://bugs.alpinelinux.org/issues/6375
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \
&& apk add --no-cache nghttp2-dev@edge \
\
&& wget -O httpd.tar.bz2 "$HTTPD_BZ2_URL" \
&& echo "$HTTPD_SHA1 *httpd.tar.bz2" | sha1sum -c - \
Expand Down Expand Up @@ -77,8 +80,11 @@ RUN set -x \
| xargs -r apk info --installed \
| sort -u \
)" \
# `apk update` instead of --no-cache since `apk del` gets confused with `@edge` packages if there is no cache
&& apk update \
&& apk add --virtual .httpd-rundeps $runDeps \
&& apk del .build-deps
&& apk del .build-deps \
&& rm -rf /var/cache/apk/*

COPY httpd-foreground /usr/local/bin/

Expand Down

0 comments on commit 924dbad

Please sign in to comment.