-
Notifications
You must be signed in to change notification settings - Fork 347
/
Dockerfile
65 lines (57 loc) · 1.85 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM debian:jessie
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
#RUN groupadd -r www-data && useradd -r --create-home -g www-data www-data
ENV HTTPD_PREFIX /usr/local/apache2
ENV PATH $PATH:$HTTPD_PREFIX/bin
RUN mkdir -p "$HTTPD_PREFIX" \
&& chown www-data:www-data "$HTTPD_PREFIX"
WORKDIR $HTTPD_PREFIX
# install httpd runtime dependencies
# https://httpd.apache.org/docs/2.4/install.html#requirements
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libapr1 \
libaprutil1 \
libpcre++0 \
libssl1.0.0 \
&& rm -r /var/lib/apt/lists/*
# see https://httpd.apache.org/download.cgi#verify
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys A93D62ECC3C8EA12DB220EC934EA76E6791485A8
ENV HTTPD_VERSION 2.4.17
ENV HTTPD_BZ2_URL https://www.apache.org/dist/httpd/httpd-$HTTPD_VERSION.tar.bz2
RUN buildDeps=' \
ca-certificates \
curl \
bzip2 \
gcc \
libapr1-dev \
libaprutil1-dev \
libc6-dev \
libpcre++-dev \
libssl-dev \
make \
' \
set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& rm -r /var/lib/apt/lists/* \
&& curl -SL "$HTTPD_BZ2_URL" -o httpd.tar.bz2 \
&& curl -SL "$HTTPD_BZ2_URL.asc" -o httpd.tar.bz2.asc \
&& gpg --verify httpd.tar.bz2.asc \
&& mkdir -p src/httpd \
&& tar -xvf httpd.tar.bz2 -C src/httpd --strip-components=1 \
&& rm httpd.tar.bz2* \
&& cd src/httpd \
&& ./configure --enable-so --enable-ssl --prefix=$HTTPD_PREFIX \
&& make -j"$(nproc)" \
&& make install \
&& cd ../../ \
&& rm -r src/httpd \
&& sed -ri ' \
s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
' /usr/local/apache2/conf/httpd.conf \
&& apt-get purge -y --auto-remove $buildDeps
COPY httpd-foreground /usr/local/bin/
EXPOSE 80
CMD ["httpd-foreground"]