From 6b54c7fa3f42f0eaade30c1bbb05d5fc2c0b39c2 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 27 Aug 2014 15:18:39 -0600 Subject: [PATCH] Add php 5.3, 5.4, and 5.6 fixing the update script --- 5.3/Dockerfile | 28 ++++++++++++++ 5.3/apache/Dockerfile | 69 +++++++++++++++++++++++++++++++++++ 5.4/Dockerfile | 27 ++++++++++++++ 5.4/apache/Dockerfile | 68 ++++++++++++++++++++++++++++++++++ 5.5/Dockerfile | 4 +- 5.5/apache/Dockerfile | 4 +- 5.6/Dockerfile | 27 ++++++++++++++ 5.6/apache/Dockerfile | 68 ++++++++++++++++++++++++++++++++++ generate-stackbrew-library.sh | 2 +- update.sh | 7 +++- 10 files changed, 297 insertions(+), 7 deletions(-) create mode 100644 5.3/Dockerfile create mode 100644 5.3/apache/Dockerfile create mode 100644 5.4/Dockerfile create mode 100644 5.4/apache/Dockerfile create mode 100644 5.6/Dockerfile create mode 100644 5.6/apache/Dockerfile diff --git a/5.3/Dockerfile b/5.3/Dockerfile new file mode 100644 index 00000000..f28befad --- /dev/null +++ b/5.3/Dockerfile @@ -0,0 +1,28 @@ +FROM buildpack-deps + +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/* \ + && 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 \ + && dpkg -i bison_2.7.1.dfsg-1_amd64.deb \ + && rm *.deb \ + && curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \ + && curl -SL "http://us2.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 \ + && rm php.tar.bz2* \ + && cd /usr/src/php \ + && ./buildconf --force \ + && ./configure --disable-cgi \ + && make -j"$(nproc)" \ + && make install \ + && dpkg -r bison libbison-dev \ + && apt-get purge -y --auto-remove autoconf2.13 curl \ + && rm -r /usr/src/php diff --git a/5.3/apache/Dockerfile b/5.3/apache/Dockerfile new file mode 100644 index 00000000..be3e5aab --- /dev/null +++ b/5.3/apache/Dockerfile @@ -0,0 +1,69 @@ +FROM buildpack-deps + +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/* \ + && 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 \ + && dpkg -i bison_2.7.1.dfsg-1_amd64.deb \ + && rm *.deb \ + && curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \ + && curl -SL "http://us2.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 \ + && rm php.tar.bz2* \ + && cd /usr/src/php \ + && ./buildconf --force \ + && ./configure --disable-cgi \ + && 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\n\tSetHandler application/x-httpd-php\n \ + ' /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 "Hello, World!'; ?>" >> /var/www/html/index.php \ + && cd /usr/src/php \ + && make clean \ + && ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-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 \ + && rm -r /usr/src/php + +ENV PATH $PATH:/usr/local/apache2/bin + +WORKDIR /var/www/html +VOLUME /var/www/html + +EXPOSE 80 +CMD ["apachectl", "start", "-DFOREGROUND"] diff --git a/5.4/Dockerfile b/5.4/Dockerfile new file mode 100644 index 00000000..91f67abf --- /dev/null +++ b/5.4/Dockerfile @@ -0,0 +1,27 @@ +FROM buildpack-deps + +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 \ + && dpkg -i bison_2.7.1.dfsg-1_amd64.deb \ + && rm *.deb \ + && curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \ + && curl -SL "http://us2.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 \ + && rm php.tar.bz2* \ + && cd /usr/src/php \ + && ./buildconf --force \ + && ./configure --disable-cgi \ + && make -j"$(nproc)" \ + && make install \ + && dpkg -r bison libbison-dev \ + && apt-get purge -y --auto-remove curl \ + && rm -r /usr/src/php diff --git a/5.4/apache/Dockerfile b/5.4/apache/Dockerfile new file mode 100644 index 00000000..45feb4f3 --- /dev/null +++ b/5.4/apache/Dockerfile @@ -0,0 +1,68 @@ +FROM buildpack-deps + +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 \ + && dpkg -i bison_2.7.1.dfsg-1_amd64.deb \ + && rm *.deb \ + && curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \ + && curl -SL "http://us2.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 \ + && rm php.tar.bz2* \ + && cd /usr/src/php \ + && ./buildconf --force \ + && ./configure --disable-cgi \ + && 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\n\tSetHandler application/x-httpd-php\n \ + ' /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 "Hello, World!'; ?>" >> /var/www/html/index.php \ + && cd /usr/src/php \ + && make clean \ + && ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-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 ["apachectl", "start", "-DFOREGROUND"] diff --git a/5.5/Dockerfile b/5.5/Dockerfile index 9fbb02ff..f0d874a9 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -22,6 +22,6 @@ RUN set -x \ && ./configure --disable-cgi \ && make -j"$(nproc)" \ && make install \ - && apt-get purge -y curl \ - && apt-get autoremove -y \ + && dpkg -r bison libbison-dev \ + && apt-get purge -y --auto-remove curl \ && rm -r /usr/src/php diff --git a/5.5/apache/Dockerfile b/5.5/apache/Dockerfile index dd554821..7e69af7b 100644 --- a/5.5/apache/Dockerfile +++ b/5.5/apache/Dockerfile @@ -55,8 +55,8 @@ RUN set -x \ && make -j"$(nproc)" \ && make install \ && cp php.ini-development /usr/local/lib/php.ini \ - && apt-get purge -y curl \ - && apt-get autoremove -y \ + && dpkg -r bison libbison-dev \ + && apt-get purge -y --auto-remove curl \ && rm -r /usr/src/php ENV PATH $PATH:/usr/local/apache2/bin diff --git a/5.6/Dockerfile b/5.6/Dockerfile new file mode 100644 index 00000000..403958ef --- /dev/null +++ b/5.6/Dockerfile @@ -0,0 +1,27 @@ +FROM buildpack-deps + +RUN gpg --keyserver pgp.mit.edu --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 0BD78B5F97500D450838F95DFE857D9A90D90EC1 + +ENV PHP_VERSION 5.6.0 + +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 \ + && dpkg -i bison_2.7.1.dfsg-1_amd64.deb \ + && rm *.deb \ + && curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \ + && curl -SL "http://us2.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 \ + && rm php.tar.bz2* \ + && cd /usr/src/php \ + && ./buildconf --force \ + && ./configure --disable-cgi \ + && make -j"$(nproc)" \ + && make install \ + && dpkg -r bison libbison-dev \ + && apt-get purge -y --auto-remove curl \ + && rm -r /usr/src/php diff --git a/5.6/apache/Dockerfile b/5.6/apache/Dockerfile new file mode 100644 index 00000000..129b7a35 --- /dev/null +++ b/5.6/apache/Dockerfile @@ -0,0 +1,68 @@ +FROM buildpack-deps + +RUN gpg --keyserver pgp.mit.edu --recv-keys 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 0BD78B5F97500D450838F95DFE857D9A90D90EC1 + +ENV PHP_VERSION 5.6.0 + +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 \ + && dpkg -i bison_2.7.1.dfsg-1_amd64.deb \ + && rm *.deb \ + && curl -SL "http://us2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2 \ + && curl -SL "http://us2.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 \ + && rm php.tar.bz2* \ + && cd /usr/src/php \ + && ./buildconf --force \ + && ./configure --disable-cgi \ + && 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\n\tSetHandler application/x-httpd-php\n \ + ' /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 "Hello, World!'; ?>" >> /var/www/html/index.php \ + && cd /usr/src/php \ + && make clean \ + && ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-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 ["apachectl", "start", "-DFOREGROUND"] diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 0d5627ea..72988098 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -3,7 +3,7 @@ set -e declare -A aliases aliases=( - [5.5]='5 latest' + [5.6]='5 latest' ) cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" diff --git a/update.sh b/update.sh index aa7847a9..847f46c1 100755 --- a/update.sh +++ b/update.sh @@ -3,7 +3,10 @@ set -e declare -A gpgKeys gpgKeys=( + [5.6]='6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 0BD78B5F97500D450838F95DFE857D9A90D90EC1' [5.5]='0BD78B5F97500D450838F95DFE857D9A90D90EC1 0B96609E270F565C13292B24C13C70B87267B52D' + [5.4]='F38252826ACD957EF380D39F2F7956BC5DA04B5D' + [5.3]='0B96609E270F565C13292B24C13C70B87267B52D 0A95E9A026542D53835E3F3A7DEC4E69FC9C83D7' ) # see http://php.net/downloads.php @@ -15,12 +18,12 @@ if [ ${#versions[@]} -eq 0 ]; then fi versions=( "${versions[@]%/}" ) -packagesUrl='http://php.net/releases/index.php?serialize=1&version=5' +packagesUrl='http://php.net/releases/index.php?serialize=1&version=5&max=100' packages="$(echo "$packagesUrl" | sed -r 's/[^a-zA-Z.-]+/-/g')" curl -sSL "${packagesUrl}" > "$packages" for version in "${versions[@]}"; do - fullVersion="$(sed -r 's/.*"filename";s:[0-9]+:"php-([^"]+)\.tar\.bz2".*/\1/' $packages)" + fullVersion="$(sed 's/;/;\n/g' $packages | grep -e 'php-'"$version"'.*\.tar\.bz2' | sed -r 's/.*php-('"$version"'[^"]+)\.tar\.bz2.*/\1/' | sort -V | tail -1)" gpgKey="${gpgKeys[$version]}" if [ -z "$gpgKey" ]; then echo >&2 "ERROR: missing GPG key fingerprint for $version"