Skip to content

Commit 52985c8

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

File tree

9 files changed

+659
-57
lines changed

9 files changed

+659
-57
lines changed

.docker/php53/Dockerfile

Lines changed: 61 additions & 4 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; \
@@ -40,9 +50,56 @@ 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

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: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,82 @@
11
FROM php:5.4-cli
22

3+
RUN set -eux; \
4+
codename='jessie'; \
5+
{ \
6+
echo "deb http://archive.debian.org/debian ${codename} main"; \
7+
echo "deb http://archive.debian.org/debian ${codename}-backports main"; \
8+
echo "deb http://archive.debian.org/debian-security ${codename}/updates main"; \
9+
} > /etc/apt/sources.list;
10+
311
RUN docker-php-ext-install pdo
412
RUN docker-php-ext-install pdo_mysql
513
RUN docker-php-ext-install mbstring
14+
15+
# Install APC PHP extension
16+
#
17+
RUN set -eux; \
18+
pecl install apc-3.1.13; \
19+
docker-php-ext-enable apc; \
20+
rm -r /tmp/pear;
21+
22+
# Install memcache PHP extension
23+
#
24+
ARG MEMCACHE_VERSION
25+
RUN set -eux; \
26+
buildDeps=' \
27+
libzip-dev \
28+
'; \
29+
apt-get update; \
30+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
31+
$buildDeps \
32+
; \
33+
\
34+
pecl install memcache-${MEMCACHE_VERSION}; \
35+
docker-php-ext-enable memcache; \
36+
\
37+
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
38+
$buildDeps \
39+
; \
40+
apt-get clean; \
41+
rm -rf /var/lib/apt/lists/*; \
42+
rm -r /tmp/pear
43+
44+
# Install composer
45+
#
46+
RUN set -eux; \
47+
composerVersion='1.10.27'; \
48+
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
49+
\
50+
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
51+
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
52+
| sha256sum -cw --status; \
53+
\
54+
{ \
55+
echo '#! /usr/bin/env php'; \
56+
cat /usr/local/bin/composer-installer.php; \
57+
} > /usr/local/bin/composer-installer; \
58+
rm /usr/local/bin/composer-installer.php; \
59+
chmod +x /usr/local/bin/composer-installer; \
60+
\
61+
composer-installer \
62+
--disable-tls \
63+
--version="${composerVersion}" \
64+
--filename=composer \
65+
--install-dir=/usr/local/bin \
66+
; \
67+
\
68+
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
69+
| sha256sum -cw --status; \
70+
\
71+
composer --version; \
72+
\
73+
apt-get update; \
74+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
75+
git \
76+
libzip-dev \
77+
unzip \
78+
; \
79+
rm -r /var/lib/apt/lists/*; \
80+
\
81+
docker-php-ext-install zip; \
82+
:;

.docker/php55_71/Dockerfile

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,88 @@
11
ARG PHP_TAG
22
FROM php:${PHP_TAG}
33

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

.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)