Skip to content

Commit 6b54c7f

Browse files
committed
Add php 5.3, 5.4, and 5.6 fixing the update script
1 parent 4e73501 commit 6b54c7f

File tree

10 files changed

+297
-7
lines changed

10 files changed

+297
-7
lines changed

5.3/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM buildpack-deps
2+
3+
RUN gpg --keyserver pgp.mit.edu --recv-keys 0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7
4+
5+
ENV PHP_VERSION 5.3.29
6+
7+
# php 5.3 needs older autoconf
8+
RUN set -x \
9+
&& apt-get update && apt-get install -y autoconf2.13 curl && rm -r /var/lib/apt/lists/* \
10+
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
11+
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
12+
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
13+
&& dpkg -i bison_2.7.1.dfsg-1_amd64.deb \
14+
&& rm *.deb \
15+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
16+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
17+
&& gpg --verify php.tar.bz2.asc \
18+
&& mkdir -p /usr/src/php \
19+
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
20+
&& rm php.tar.bz2* \
21+
&& cd /usr/src/php \
22+
&& ./buildconf --force \
23+
&& ./configure --disable-cgi \
24+
&& make -j"$(nproc)" \
25+
&& make install \
26+
&& dpkg -r bison libbison-dev \
27+
&& apt-get purge -y --auto-remove autoconf2.13 curl \
28+
&& rm -r /usr/src/php

5.3/apache/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM buildpack-deps
2+
3+
RUN gpg --keyserver pgp.mit.edu --recv-keys 0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7
4+
5+
ENV PHP_VERSION 5.3.29
6+
7+
# php 5.3 needs older autoconf
8+
RUN set -x \
9+
&& apt-get update && apt-get install -y autoconf2.13 curl && rm -r /var/lib/apt/lists/* \
10+
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
11+
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
12+
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
13+
&& dpkg -i bison_2.7.1.dfsg-1_amd64.deb \
14+
&& rm *.deb \
15+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
16+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
17+
&& gpg --verify php.tar.bz2.asc \
18+
&& mkdir -p /usr/src/php \
19+
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
20+
&& rm php.tar.bz2* \
21+
&& cd /usr/src/php \
22+
&& ./buildconf --force \
23+
&& ./configure --disable-cgi \
24+
&& make -j"$(nproc)" \
25+
&& make install \
26+
\
27+
&& cd / \
28+
&& gpg --keyserver pgp.mit.edu --recv-keys A93D62ECC3C8EA12DB220EC934EA76E6791485A8 \
29+
&& apt-get update && apt-get install -y libapr1-dev libaprutil1-dev && rm -r /var/lib/apt/lists/* \
30+
&& curl -SL "http://apache.osuosl.org/httpd/httpd-2.4.10.tar.bz2" -o httpd.tar.bz2 \
31+
&& curl -SL "https://www.apache.org/dist/httpd/httpd-2.4.10.tar.bz2.asc" -o httpd.tar.bz2.asc \
32+
&& gpg --verify httpd.tar.bz2.asc \
33+
&& mkdir -p /usr/src/httpd \
34+
&& tar -xvf httpd.tar.bz2 -C /usr/src/httpd --strip-components=1 \
35+
&& rm httpd.tar.bz2.* \
36+
&& cd /usr/src/httpd \
37+
&& ./configure --enable-so \
38+
&& make -j"$(nproc)" \
39+
&& make install \
40+
&& cd / \
41+
&& rm -r /usr/src/httpd \
42+
&& mkdir -p /var/www/html \
43+
&& sed -r ' \
44+
s/(DirectoryIndex index[.])html/\1php/; \
45+
s!/usr/local/apache2/htdocs!/var/www/html!g; \
46+
s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
47+
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
48+
$ a<FilesMatch \\.php$>\n\tSetHandler application/x-httpd-php\n</FilesMatch> \
49+
' /usr/local/apache2/conf/httpd.conf > /etc/apache2/httpd.conf \
50+
&& rm /usr/local/apache2/conf/httpd.conf \
51+
&& ln -s /etc/apache2/httpd.conf /usr/local/apache2/conf/httpd.conf \
52+
&& echo "<html><head></head><body><?php echo '<h1>Hello, World!</h1>'; ?></body></html>" >> /var/www/html/index.php \
53+
&& cd /usr/src/php \
54+
&& make clean \
55+
&& ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql \
56+
&& make -j"$(nproc)" \
57+
&& make install \
58+
&& cp php.ini-development /usr/local/lib/php.ini \
59+
&& dpkg -r bison libbison-dev \
60+
&& apt-get purge -y --auto-remove autoconf2.13 curl \
61+
&& rm -r /usr/src/php
62+
63+
ENV PATH $PATH:/usr/local/apache2/bin
64+
65+
WORKDIR /var/www/html
66+
VOLUME /var/www/html
67+
68+
EXPOSE 80
69+
CMD ["apachectl", "start", "-DFOREGROUND"]

5.4/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM buildpack-deps
2+
3+
RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA04B5D
4+
5+
ENV PHP_VERSION 5.4.32
6+
7+
RUN set -x \
8+
&& apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/* \
9+
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
10+
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
11+
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
12+
&& dpkg -i bison_2.7.1.dfsg-1_amd64.deb \
13+
&& rm *.deb \
14+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
15+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
16+
&& gpg --verify php.tar.bz2.asc \
17+
&& mkdir -p /usr/src/php \
18+
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
19+
&& rm php.tar.bz2* \
20+
&& cd /usr/src/php \
21+
&& ./buildconf --force \
22+
&& ./configure --disable-cgi \
23+
&& make -j"$(nproc)" \
24+
&& make install \
25+
&& dpkg -r bison libbison-dev \
26+
&& apt-get purge -y --auto-remove curl \
27+
&& rm -r /usr/src/php

5.4/apache/Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM buildpack-deps
2+
3+
RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA04B5D
4+
5+
ENV PHP_VERSION 5.4.32
6+
7+
RUN set -x \
8+
&& apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/* \
9+
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
10+
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
11+
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
12+
&& dpkg -i bison_2.7.1.dfsg-1_amd64.deb \
13+
&& rm *.deb \
14+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
15+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
16+
&& gpg --verify php.tar.bz2.asc \
17+
&& mkdir -p /usr/src/php \
18+
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
19+
&& rm php.tar.bz2* \
20+
&& cd /usr/src/php \
21+
&& ./buildconf --force \
22+
&& ./configure --disable-cgi \
23+
&& make -j"$(nproc)" \
24+
&& make install \
25+
\
26+
&& cd / \
27+
&& gpg --keyserver pgp.mit.edu --recv-keys A93D62ECC3C8EA12DB220EC934EA76E6791485A8 \
28+
&& apt-get update && apt-get install -y libapr1-dev libaprutil1-dev && rm -r /var/lib/apt/lists/* \
29+
&& curl -SL "http://apache.osuosl.org/httpd/httpd-2.4.10.tar.bz2" -o httpd.tar.bz2 \
30+
&& curl -SL "https://www.apache.org/dist/httpd/httpd-2.4.10.tar.bz2.asc" -o httpd.tar.bz2.asc \
31+
&& gpg --verify httpd.tar.bz2.asc \
32+
&& mkdir -p /usr/src/httpd \
33+
&& tar -xvf httpd.tar.bz2 -C /usr/src/httpd --strip-components=1 \
34+
&& rm httpd.tar.bz2.* \
35+
&& cd /usr/src/httpd \
36+
&& ./configure --enable-so \
37+
&& make -j"$(nproc)" \
38+
&& make install \
39+
&& cd / \
40+
&& rm -r /usr/src/httpd \
41+
&& mkdir -p /var/www/html \
42+
&& sed -r ' \
43+
s/(DirectoryIndex index[.])html/\1php/; \
44+
s!/usr/local/apache2/htdocs!/var/www/html!g; \
45+
s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
46+
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
47+
$ a<FilesMatch \\.php$>\n\tSetHandler application/x-httpd-php\n</FilesMatch> \
48+
' /usr/local/apache2/conf/httpd.conf > /etc/apache2/httpd.conf \
49+
&& rm /usr/local/apache2/conf/httpd.conf \
50+
&& ln -s /etc/apache2/httpd.conf /usr/local/apache2/conf/httpd.conf \
51+
&& echo "<html><head></head><body><?php echo '<h1>Hello, World!</h1>'; ?></body></html>" >> /var/www/html/index.php \
52+
&& cd /usr/src/php \
53+
&& make clean \
54+
&& ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql \
55+
&& make -j"$(nproc)" \
56+
&& make install \
57+
&& cp php.ini-development /usr/local/lib/php.ini \
58+
&& dpkg -r bison libbison-dev \
59+
&& apt-get purge -y --auto-remove curl \
60+
&& rm -r /usr/src/php
61+
62+
ENV PATH $PATH:/usr/local/apache2/bin
63+
64+
WORKDIR /var/www/html
65+
VOLUME /var/www/html
66+
67+
EXPOSE 80
68+
CMD ["apachectl", "start", "-DFOREGROUND"]

5.5/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ RUN set -x \
2222
&& ./configure --disable-cgi \
2323
&& make -j"$(nproc)" \
2424
&& make install \
25-
&& apt-get purge -y curl \
26-
&& apt-get autoremove -y \
25+
&& dpkg -r bison libbison-dev \
26+
&& apt-get purge -y --auto-remove curl \
2727
&& rm -r /usr/src/php

5.5/apache/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ RUN set -x \
5555
&& make -j"$(nproc)" \
5656
&& make install \
5757
&& cp php.ini-development /usr/local/lib/php.ini \
58-
&& apt-get purge -y curl \
59-
&& apt-get autoremove -y \
58+
&& dpkg -r bison libbison-dev \
59+
&& apt-get purge -y --auto-remove curl \
6060
&& rm -r /usr/src/php
6161

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

5.6/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM buildpack-deps
2+
3+
RUN gpg --keyserver pgp.mit.edu --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 0BD78B5F97500D450838F95DFE857D9A90D90EC1
4+
5+
ENV PHP_VERSION 5.6.0
6+
7+
RUN set -x \
8+
&& apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/* \
9+
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
10+
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
11+
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
12+
&& dpkg -i bison_2.7.1.dfsg-1_amd64.deb \
13+
&& rm *.deb \
14+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
15+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
16+
&& gpg --verify php.tar.bz2.asc \
17+
&& mkdir -p /usr/src/php \
18+
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
19+
&& rm php.tar.bz2* \
20+
&& cd /usr/src/php \
21+
&& ./buildconf --force \
22+
&& ./configure --disable-cgi \
23+
&& make -j"$(nproc)" \
24+
&& make install \
25+
&& dpkg -r bison libbison-dev \
26+
&& apt-get purge -y --auto-remove curl \
27+
&& rm -r /usr/src/php

5.6/apache/Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM buildpack-deps
2+
3+
RUN gpg --keyserver pgp.mit.edu --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 0BD78B5F97500D450838F95DFE857D9A90D90EC1
4+
5+
ENV PHP_VERSION 5.6.0
6+
7+
RUN set -x \
8+
&& apt-get update && apt-get install -y curl && rm -r /var/lib/apt/lists/* \
9+
&& curl -SLO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb \
10+
&& curl -SLO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb \
11+
&& dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb \
12+
&& dpkg -i bison_2.7.1.dfsg-1_amd64.deb \
13+
&& rm *.deb \
14+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \
15+
&& curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2.asc/from/this/mirror" -o php.tar.bz2.asc \
16+
&& gpg --verify php.tar.bz2.asc \
17+
&& mkdir -p /usr/src/php \
18+
&& tar -xvf php.tar.bz2 -C /usr/src/php --strip-components=1 \
19+
&& rm php.tar.bz2* \
20+
&& cd /usr/src/php \
21+
&& ./buildconf --force \
22+
&& ./configure --disable-cgi \
23+
&& make -j"$(nproc)" \
24+
&& make install \
25+
\
26+
&& cd / \
27+
&& gpg --keyserver pgp.mit.edu --recv-keys A93D62ECC3C8EA12DB220EC934EA76E6791485A8 \
28+
&& apt-get update && apt-get install -y libapr1-dev libaprutil1-dev && rm -r /var/lib/apt/lists/* \
29+
&& curl -SL "http://apache.osuosl.org/httpd/httpd-2.4.10.tar.bz2" -o httpd.tar.bz2 \
30+
&& curl -SL "https://www.apache.org/dist/httpd/httpd-2.4.10.tar.bz2.asc" -o httpd.tar.bz2.asc \
31+
&& gpg --verify httpd.tar.bz2.asc \
32+
&& mkdir -p /usr/src/httpd \
33+
&& tar -xvf httpd.tar.bz2 -C /usr/src/httpd --strip-components=1 \
34+
&& rm httpd.tar.bz2.* \
35+
&& cd /usr/src/httpd \
36+
&& ./configure --enable-so \
37+
&& make -j"$(nproc)" \
38+
&& make install \
39+
&& cd / \
40+
&& rm -r /usr/src/httpd \
41+
&& mkdir -p /var/www/html \
42+
&& sed -r ' \
43+
s/(DirectoryIndex index[.])html/\1php/; \
44+
s!/usr/local/apache2/htdocs!/var/www/html!g; \
45+
s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \
46+
s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \
47+
$ a<FilesMatch \\.php$>\n\tSetHandler application/x-httpd-php\n</FilesMatch> \
48+
' /usr/local/apache2/conf/httpd.conf > /etc/apache2/httpd.conf \
49+
&& rm /usr/local/apache2/conf/httpd.conf \
50+
&& ln -s /etc/apache2/httpd.conf /usr/local/apache2/conf/httpd.conf \
51+
&& echo "<html><head></head><body><?php echo '<h1>Hello, World!</h1>'; ?></body></html>" >> /var/www/html/index.php \
52+
&& cd /usr/src/php \
53+
&& make clean \
54+
&& ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql \
55+
&& make -j"$(nproc)" \
56+
&& make install \
57+
&& cp php.ini-development /usr/local/lib/php.ini \
58+
&& dpkg -r bison libbison-dev \
59+
&& apt-get purge -y --auto-remove curl \
60+
&& rm -r /usr/src/php
61+
62+
ENV PATH $PATH:/usr/local/apache2/bin
63+
64+
WORKDIR /var/www/html
65+
VOLUME /var/www/html
66+
67+
EXPOSE 80
68+
CMD ["apachectl", "start", "-DFOREGROUND"]

generate-stackbrew-library.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
declare -A aliases
55
aliases=(
6-
[5.5]='5 latest'
6+
[5.6]='5 latest'
77
)
88

99
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

update.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ set -e
33

44
declare -A gpgKeys
55
gpgKeys=(
6+
[5.6]='6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 0BD78B5F97500D450838F95DFE857D9A90D90EC1'
67
[5.5]='0BD78B5F97500D450838F95DFE857D9A90D90EC1 0B96609E270F565C13292B24C13C70B87267B52D'
8+
[5.4]='F38252826ACD957EF380D39F2F7956BC5DA04B5D'
9+
[5.3]='0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7'
710
)
811
# see http://php.net/downloads.php
912

@@ -15,12 +18,12 @@ if [ ${#versions[@]} -eq 0 ]; then
1518
fi
1619
versions=( "${versions[@]%/}" )
1720

18-
packagesUrl='http://php.net/releases/index.php?serialize=1&version=5'
21+
packagesUrl='http://php.net/releases/index.php?serialize=1&version=5&max=100'
1922
packages="$(echo "$packagesUrl" | sed -r 's/[^a-zA-Z.-]+/-/g')"
2023
curl -sSL "${packagesUrl}" > "$packages"
2124

2225
for version in "${versions[@]}"; do
23-
fullVersion="$(sed -r 's/.*"filename";s:[0-9]+:"php-([^"]+)\.tar\.bz2".*/\1/' $packages)"
26+
fullVersion="$(sed 's/;/;\n/g' $packages | grep -e 'php-'"$version"'.*\.tar\.bz2' | sed -r 's/.*php-('"$version"'[^"]+)\.tar\.bz2.*/\1/' | sort -V | tail -1)"
2427
gpgKey="${gpgKeys[$version]}"
2528
if [ -z "$gpgKey" ]; then
2629
echo >&2 "ERROR: missing GPG key fingerprint for $version"

0 commit comments

Comments
 (0)