diff --git a/2.4/Dockerfile b/2.4/Dockerfile index 50dc081..2b96e88 100644 --- a/2.4/Dockerfile +++ b/2.4/Dockerfile @@ -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 \ @@ -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/* @@ -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" \ @@ -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 \ \ diff --git a/2.4/alpine/Dockerfile b/2.4/alpine/Dockerfile index 35ab8f0..67dfff6 100644 --- a/2.4/alpine/Dockerfile +++ b/2.4/alpine/Dockerfile @@ -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 - \ @@ -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/