1- FROM buildpack-deps:jessie
1+ FROM buildpack-deps:jessie as php53
22
33ENV PHP_VERSION 5.3.29
44
5+ RUN set -eux; \
6+ codename='jessie' ; \
7+ { \
8+ echo "deb http://archive.debian.org/debian ${codename} main" ; \
9+ echo "deb http://archive.debian.org/debian ${codename}-backports main" ; \
10+ echo "deb http://archive.debian.org/debian-security ${codename}/updates main" ; \
11+ } > /etc/apt/sources.list;
12+
513# php 5.3 needs older autoconf
614RUN set -eux; \
715 \
816 apt-get update; \
9- apt-get install -y \
17+ apt-get install -y --force-yes --no-upgrade --no-install-recommends \
1018 curl \
1119 autoconf2.13 \
1220 ; \
@@ -18,7 +26,7 @@ RUN set -eux; \
1826 dpkg -i bison_2.7.1.dfsg-1_amd64.deb; \
1927 rm *.deb; \
2028 \
21- curl -sSLf "https://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2; \
29+ curl --insecure - sSLf "https://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2; \
2230 echo 'c4e1cf6972b2a9c7f2777a18497d83bf713cdbecabb65d3ff62ba441aebb0091 php.tar.bz2' | sha256sum -cw --status; \
2331 \
2432 mkdir -p /usr/src/php; \
@@ -32,6 +40,8 @@ RUN set -eux; \
3240 --with-pdo-mysql \
3341 --with-zlib \
3442 --enable-mbstring \
43+ --with-openssl=/usr \
44+ --with-libdir=lib/x86_64-linux-gnu \
3545 ; \
3646 make -j"$(nproc)" ; \
3747 make install; \
@@ -40,11 +50,15 @@ RUN set -eux; \
4050 bison \
4151 libbison-dev \
4252 ; \
43- apt-get purge -y --auto-remove \
53+ apt-get purge -y --force-yes -- auto-remove \
4454 autoconf2.13 \
4555 ; \
4656 rm -r /usr/src/php
4757
58+ CMD ["php" , "-a" ]
59+
60+ FROM php53
61+
4862# Install APC PHP extension
4963#
5064RUN set -eux; \
@@ -54,4 +68,38 @@ RUN set -eux; \
5468 \
5569 rm -r /tmp/pear;
5670
57- CMD ["php" , "-a" ]
71+ # Install composer
72+ #
73+ RUN set -eux; \
74+ composerVersion='1.10.27' ; \
75+ installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer' ; \
76+ \
77+ curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
78+ echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
79+ | sha256sum -cw --status; \
80+ \
81+ { \
82+ echo '#! /usr/bin/env php' ; \
83+ cat /usr/local/bin/composer-installer.php; \
84+ } > /usr/local/bin/composer-installer; \
85+ rm /usr/local/bin/composer-installer.php; \
86+ chmod +x /usr/local/bin/composer-installer; \
87+ \
88+ composer-installer \
89+ --disable-tls \
90+ --version="${composerVersion}" \
91+ --filename=composer \
92+ --install-dir=/usr/local/bin \
93+ ; \
94+ \
95+ echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
96+ | sha256sum -cw --status; \
97+ \
98+ composer --version; \
99+ \
100+ apt-get update; \
101+ apt-get install -y --force-yes --no-upgrade --no-install-recommends \
102+ git \
103+ ; \
104+ rm -r /var/lib/apt/lists/*; \
105+ :;
0 commit comments