Skip to content

Commit 6d95fcc

Browse files
committed
Fix docker images build to handle old linux distributions
1 parent 0978095 commit 6d95fcc

File tree

9 files changed

+641
-55
lines changed

9 files changed

+641
-55
lines changed

.docker/php53/Dockerfile

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
FROM buildpack-deps:jessie
1+
FROM buildpack-deps:jessie as php53
22

33
ENV 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
614
RUN 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; \
@@ -46,3 +56,50 @@ RUN set -eux; \
4656
rm -r /usr/src/php
4757

4858
CMD ["php", "-a"]
59+
60+
FROM php53
61+
62+
# Install APC PHP extension
63+
#
64+
RUN set -eux; \
65+
\
66+
pecl install apc-3.1.13; \
67+
echo 'extension=apc.so' >> /usr/local/lib/php.ini; \
68+
\
69+
rm -r /tmp/pear;
70+
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+
:;

.docker/php54/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,72 @@ FROM php:5.4-cli
33
RUN docker-php-ext-install pdo
44
RUN docker-php-ext-install pdo_mysql
55
RUN docker-php-ext-install mbstring
6+
7+
# Install APC PHP extension
8+
#
9+
RUN set -eux; \
10+
pecl install apc-3.1.13; \
11+
docker-php-ext-enable apc; \
12+
rm -r /tmp/pear;
13+
14+
# Install memcache PHP extension
15+
#
16+
ARG MEMCACHE_VERSION
17+
RUN set -eux; \
18+
buildDeps=' \
19+
libzip-dev \
20+
'; \
21+
apt-get update; \
22+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
23+
$buildDeps \
24+
; \
25+
\
26+
pecl install memcache-${MEMCACHE_VERSION}; \
27+
docker-php-ext-enable memcache; \
28+
\
29+
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
30+
$buildDeps \
31+
; \
32+
apt-get clean; \
33+
rm -rf /var/lib/apt/lists/*; \
34+
rm -r /tmp/pear
35+
36+
# Install composer
37+
#
38+
RUN set -eux; \
39+
composerVersion='1.10.27'; \
40+
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
41+
\
42+
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
43+
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
44+
| sha256sum -cw --status; \
45+
\
46+
{ \
47+
echo '#! /usr/bin/env php'; \
48+
cat /usr/local/bin/composer-installer.php; \
49+
} > /usr/local/bin/composer-installer; \
50+
rm /usr/local/bin/composer-installer.php; \
51+
chmod +x /usr/local/bin/composer-installer; \
52+
\
53+
composer-installer \
54+
--disable-tls \
55+
--version="${composerVersion}" \
56+
--filename=composer \
57+
--install-dir=/usr/local/bin \
58+
; \
59+
\
60+
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
61+
| sha256sum -cw --status; \
62+
\
63+
composer --version; \
64+
\
65+
apt-get update; \
66+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
67+
git \
68+
libzip-dev \
69+
unzip \
70+
; \
71+
rm -r /var/lib/apt/lists/*; \
72+
\
73+
docker-php-ext-install zip; \
74+
:;

.docker/php55_71/Dockerfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,77 @@ FROM php:${PHP_TAG}
44
RUN docker-php-ext-install pdo
55
RUN docker-php-ext-install pdo_mysql
66
RUN docker-php-ext-install mbstring
7+
8+
# Install APCu PHP extension
9+
#
10+
ARG APCU_VERSION
11+
RUN set -eux; \
12+
\
13+
test x"" = x"${APCU_VERSION}" || { \
14+
pecl install apcu-${APCU_VERSION}; \
15+
docker-php-ext-enable apcu; \
16+
\
17+
rm -r /tmp/pear; \
18+
}
19+
20+
# Install memcache PHP extension
21+
#
22+
ARG MEMCACHE_VERSION
23+
RUN set -eux; \
24+
buildDeps=' \
25+
libzip-dev \
26+
'; \
27+
apt-get update; \
28+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
29+
$buildDeps \
30+
; \
31+
\
32+
pecl install memcache-${MEMCACHE_VERSION}; \
33+
docker-php-ext-enable memcache; \
34+
\
35+
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
36+
$buildDeps \
37+
; \
38+
apt-get clean; \
39+
rm -rf /var/lib/apt/lists/*; \
40+
rm -r /tmp/pear
41+
42+
# Install composer
43+
#
44+
RUN set -eux; \
45+
composerVersion='1.10.27'; \
46+
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
47+
\
48+
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
49+
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
50+
| sha256sum -cw --status; \
51+
\
52+
{ \
53+
echo '#! /usr/bin/env php'; \
54+
cat /usr/local/bin/composer-installer.php; \
55+
} > /usr/local/bin/composer-installer; \
56+
rm /usr/local/bin/composer-installer.php; \
57+
chmod +x /usr/local/bin/composer-installer; \
58+
\
59+
composer-installer \
60+
--disable-tls \
61+
--version="${composerVersion}" \
62+
--filename=composer \
63+
--install-dir=/usr/local/bin \
64+
; \
65+
\
66+
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
67+
| sha256sum -cw --status; \
68+
\
69+
composer --version; \
70+
\
71+
apt-get update; \
72+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
73+
git \
74+
libzip-dev \
75+
unzip \
76+
; \
77+
rm -r /var/lib/apt/lists/*; \
78+
\
79+
docker-php-ext-install zip; \
80+
:;

.docker/php72_73/Dockerfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,40 @@ RUN docker-php-ext-install pdo
55
RUN docker-php-ext-install pdo_mysql
66
RUN docker-php-ext-install mbstring
77

8+
# Install APCu PHP extension
9+
#
10+
ARG APCU_VERSION
11+
RUN set -eux; \
12+
\
13+
test x"" = x"${APCU_VERSION}" || { \
14+
pecl install apcu-${APCU_VERSION}; \
15+
docker-php-ext-enable apcu; \
16+
\
17+
rm -r /tmp/pear; \
18+
}
19+
20+
# Install memcache PHP extension
21+
#
22+
ARG MEMCACHE_VERSION
23+
RUN set -eux; \
24+
buildDeps=' \
25+
libzip-dev \
26+
'; \
27+
apt-get update; \
28+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
29+
$buildDeps \
30+
; \
31+
\
32+
pecl install memcache-${MEMCACHE_VERSION}; \
33+
docker-php-ext-enable memcache; \
34+
\
35+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
36+
$buildDeps \
37+
; \
38+
apt-get clean; \
39+
rm -rf /var/lib/apt/lists/*; \
40+
rm -r /tmp/pear
41+
842
# For consistent mime type file guesser
943
RUN set -eux; \
1044
distFilePath=`which file`; \
@@ -20,3 +54,43 @@ RUN set -eux; \
2054
\
2155
file /bin/ls --mime | grep application/x-executable; \
2256
:;
57+
58+
# Install composer
59+
#
60+
RUN set -eux; \
61+
composerVersion='1.10.27'; \
62+
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
63+
\
64+
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
65+
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
66+
| sha256sum -cw --status; \
67+
\
68+
{ \
69+
echo '#! /usr/bin/env php'; \
70+
cat /usr/local/bin/composer-installer.php; \
71+
} > /usr/local/bin/composer-installer; \
72+
rm /usr/local/bin/composer-installer.php; \
73+
chmod +x /usr/local/bin/composer-installer; \
74+
\
75+
composer-installer \
76+
--disable-tls \
77+
--version="${composerVersion}" \
78+
--filename=composer \
79+
--install-dir=/usr/local/bin \
80+
; \
81+
\
82+
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
83+
| sha256sum -cw --status; \
84+
\
85+
composer --version; \
86+
\
87+
apt-get update; \
88+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
89+
git \
90+
libzip-dev \
91+
unzip \
92+
; \
93+
rm -r /var/lib/apt/lists/*; \
94+
\
95+
docker-php-ext-install zip; \
96+
:;

0 commit comments

Comments
 (0)