Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions 5.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
FROM buildpack-deps
FROM buildpack-deps:jessie

RUN apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/*

##<apache2>##
##</apache2>##

RUN gpg --keyserver pgp.mit.edu --recv-keys 0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7

ENV PHP_VERSION 5.3.29

# php 5.3 needs older autoconf
RUN set -x \
&& apt-get update && apt-get install -y autoconf2.13 curl && rm -r /var/lib/apt/lists/* \
&& apt-get update && apt-get install -y autoconf2.13 && rm -r /var/lib/apt/lists/* \
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
Expand All @@ -16,15 +21,19 @@ RUN set -x \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& mkdir -p /usr/src/php \
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./buildconf --force \
&& ./configure --disable-cgi \
$(command -v apxs2 > /dev/null 2>&1 && echo '--with-apxs2' || true) \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
&& make -j"$(nproc)" \
&& make install \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove autoconf2.13 curl \
&& apt-get purge -y --auto-remove autoconf2.13 \
&& rm -r /usr/src/php

CMD ["php", "-a"]
63 changes: 23 additions & 40 deletions 5.3/apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
FROM buildpack-deps
FROM buildpack-deps:jessie

RUN apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/*

##<apache2>##
RUN apt-get update && apt-get install -y apache2-bin apache2-dev apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*

RUN rm -rf /var/www/html && mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html && chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html

# Apache + PHP requires preforking Apache for best results
RUN a2dismod mpm_event && a2enmod mpm_prefork

RUN mv /etc/apache2/apache2.conf /etc/apache2/apache2.conf.dist
COPY apache2.conf /etc/apache2/apache2.conf
##</apache2>##

RUN gpg --keyserver pgp.mit.edu --recv-keys 0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7

ENV PHP_VERSION 5.3.29

# php 5.3 needs older autoconf
RUN set -x \
&& apt-get update && apt-get install -y autoconf2.13 curl && rm -r /var/lib/apt/lists/* \
&& apt-get update && apt-get install -y autoconf2.13 && rm -r /var/lib/apt/lists/* \
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
Expand All @@ -16,54 +30,23 @@ RUN set -x \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& mkdir -p /usr/src/php \
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./buildconf --force \
&& ./configure --disable-cgi \
$(command -v apxs2 > /dev/null 2>&1 && echo '--with-apxs2' || true) \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
&& make -j"$(nproc)" \
&& make install \
\
&& cd / \
&& gpg --keyserver pgp.mit.edu --recv-keys A93D62ECC3C8EA12DB220EC934EA76E6791485A8 \
&& apt-get update && apt-get install -y libapr1-dev libaprutil1-dev && rm -r /var/lib/apt/lists/* \
&& curl -SL "http://apache.osuosl.org/httpd/httpd-2.4.10.tar.bz2" -o httpd.tar.bz2 \
&& curl -SL "https://www.apache.org/dist/httpd/httpd-2.4.10.tar.bz2.asc" -o httpd.tar.bz2.asc \
&& gpg --verify httpd.tar.bz2.asc \
&& mkdir -p /usr/src/httpd \
&& tar -xvf httpd.tar.bz2 -C /usr/src/httpd --strip-components=1 \
&& rm httpd.tar.bz2.* \
&& cd /usr/src/httpd \
&& ./configure --enable-so \
&& make -j"$(nproc)" \
&& make install \
&& cd / \
&& rm -r /usr/src/httpd \
&& mkdir -p /var/www/html \
&& sed -r ' \
s/(DirectoryIndex index[.])html/\1php/; \
s!/usr/local/apache2/htdocs!/var/www/html!g; \
s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
$ a<FilesMatch \\.php$>\n\tSetHandler application/x-httpd-php\n</FilesMatch> \
' /usr/local/apache2/conf/httpd.conf > /etc/apache2/httpd.conf \
&& rm /usr/local/apache2/conf/httpd.conf \
&& ln -s /etc/apache2/httpd.conf /usr/local/apache2/conf/httpd.conf \
&& echo "<html><head></head><body><?php echo '<h1>Hello, World!</h1>'; ?></body></html>" >> /var/www/html/index.php \
&& cd /usr/src/php \
&& make clean \
&& ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --with-pdo-mysql \
&& make -j"$(nproc)" \
&& make install \
&& cp php.ini-development /usr/local/lib/php.ini \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove autoconf2.13 curl \
&& apt-get purge -y --auto-remove autoconf2.13 \
&& rm -r /usr/src/php

ENV PATH $PATH:/usr/local/apache2/bin

WORKDIR /var/www/html
VOLUME /var/www/html

EXPOSE 80
CMD ["httpd", "-DFOREGROUND"]
CMD ["apache2", "-DFOREGROUND"]
57 changes: 57 additions & 0 deletions 5.3/apache/apache2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# see http://sources.debian.net/src/apache2/2.4.10-1/debian/config-dir/apache2.conf

Mutex file:/var/lock/apache2 default
PidFile /var/run/apache2/apache2.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User www-data
Group www-data
HostnameLookups Off
ErrorLog /proc/self/fd/2
LogLevel warn

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# ports.conf
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>

<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /proc/self/fd/1 combined

<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
DirectoryIndex index.php

DocumentRoot /var/www/html
15 changes: 11 additions & 4 deletions 5.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM buildpack-deps
FROM buildpack-deps:jessie

RUN apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/*

##<apache2>##
##</apache2>##

RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA04B5D

ENV PHP_VERSION 5.4.32

RUN set -x \
&& apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/* \
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
Expand All @@ -15,15 +19,18 @@ RUN set -x \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& mkdir -p /usr/src/php \
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./buildconf --force \
&& ./configure --disable-cgi \
$(command -v apxs2 > /dev/null 2>&1 && echo '--with-apxs2' || true) \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
&& make -j"$(nproc)" \
&& make install \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove curl \
&& rm -r /usr/src/php

CMD ["php", "-a"]
61 changes: 21 additions & 40 deletions 5.4/apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
FROM buildpack-deps
FROM buildpack-deps:jessie

RUN apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/*

##<apache2>##
RUN apt-get update && apt-get install -y apache2-bin apache2-dev apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*

RUN rm -rf /var/www/html && mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html && chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html

# Apache + PHP requires preforking Apache for best results
RUN a2dismod mpm_event && a2enmod mpm_prefork

RUN mv /etc/apache2/apache2.conf /etc/apache2/apache2.conf.dist
COPY apache2.conf /etc/apache2/apache2.conf
##</apache2>##

RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA04B5D

ENV PHP_VERSION 5.4.32

RUN set -x \
&& apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/* \
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
Expand All @@ -15,54 +28,22 @@ RUN set -x \
&& curl -SL "http://php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
&& gpg --verify php.tar.bz2.asc \
&& mkdir -p /usr/src/php \
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./buildconf --force \
&& ./configure --disable-cgi \
$(command -v apxs2 > /dev/null 2>&1 && echo '--with-apxs2' || true) \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \
&& make -j"$(nproc)" \
&& make install \
\
&& cd / \
&& gpg --keyserver pgp.mit.edu --recv-keys A93D62ECC3C8EA12DB220EC934EA76E6791485A8 \
&& apt-get update && apt-get install -y libapr1-dev libaprutil1-dev && rm -r /var/lib/apt/lists/* \
&& curl -SL "http://apache.osuosl.org/httpd/httpd-2.4.10.tar.bz2" -o httpd.tar.bz2 \
&& curl -SL "https://www.apache.org/dist/httpd/httpd-2.4.10.tar.bz2.asc" -o httpd.tar.bz2.asc \
&& gpg --verify httpd.tar.bz2.asc \
&& mkdir -p /usr/src/httpd \
&& tar -xvf httpd.tar.bz2 -C /usr/src/httpd --strip-components=1 \
&& rm httpd.tar.bz2.* \
&& cd /usr/src/httpd \
&& ./configure --enable-so \
&& make -j"$(nproc)" \
&& make install \
&& cd / \
&& rm -r /usr/src/httpd \
&& mkdir -p /var/www/html \
&& sed -r ' \
s/(DirectoryIndex index[.])html/\1php/; \
s!/usr/local/apache2/htdocs!/var/www/html!g; \
s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
$ a<FilesMatch \\.php$>\n\tSetHandler application/x-httpd-php\n</FilesMatch> \
' /usr/local/apache2/conf/httpd.conf > /etc/apache2/httpd.conf \
&& rm /usr/local/apache2/conf/httpd.conf \
&& ln -s /etc/apache2/httpd.conf /usr/local/apache2/conf/httpd.conf \
&& echo "<html><head></head><body><?php echo '<h1>Hello, World!</h1>'; ?></body></html>" >> /var/www/html/index.php \
&& cd /usr/src/php \
&& make clean \
&& ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mysqli --with-pdo-mysql \
&& make -j"$(nproc)" \
&& make install \
&& cp php.ini-development /usr/local/lib/php.ini \
&& dpkg -r bison libbison-dev \
&& apt-get purge -y --auto-remove curl \
&& rm -r /usr/src/php

ENV PATH $PATH:/usr/local/apache2/bin

WORKDIR /var/www/html
VOLUME /var/www/html

EXPOSE 80
CMD ["httpd", "-DFOREGROUND"]
CMD ["apache2", "-DFOREGROUND"]
57 changes: 57 additions & 0 deletions 5.4/apache/apache2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# see http://sources.debian.net/src/apache2/2.4.10-1/debian/config-dir/apache2.conf

Mutex file:/var/lock/apache2 default
PidFile /var/run/apache2/apache2.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User www-data
Group www-data
HostnameLookups Off
ErrorLog /proc/self/fd/2
LogLevel warn

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# ports.conf
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>

<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /proc/self/fd/1 combined

<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
DirectoryIndex index.php

DocumentRoot /var/www/html
Loading