Skip to content

Commit

Permalink
Fix docker images build to handle old linux distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Dec 27, 2023
1 parent 2a68033 commit 12dddb0
Show file tree
Hide file tree
Showing 12 changed files with 555 additions and 99 deletions.
58 changes: 53 additions & 5 deletions .docker/php53/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
FROM buildpack-deps:jessie
FROM buildpack-deps:jessie as php53

ENV PHP_VERSION 5.3.29

RUN set -eux; \
codename='jessie'; \
{ \
echo "deb http://archive.debian.org/debian ${codename} main"; \
echo "deb http://archive.debian.org/debian ${codename}-backports main"; \
echo "deb http://archive.debian.org/debian-security ${codename}/updates main"; \
} > /etc/apt/sources.list;

# php 5.3 needs older autoconf
RUN set -eux; \
\
apt-get update; \
apt-get install -y \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
curl \
autoconf2.13 \
; \
Expand All @@ -18,7 +26,7 @@ RUN set -eux; \
dpkg -i bison_2.7.1.dfsg-1_amd64.deb; \
rm *.deb; \
\
curl -sSLf "https://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2; \
curl --insecure -sSLf "https://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2; \
echo 'c4e1cf6972b2a9c7f2777a18497d83bf713cdbecabb65d3ff62ba441aebb0091 php.tar.bz2' | sha256sum -cw --status; \
\
mkdir -p /usr/src/php; \
Expand All @@ -32,6 +40,8 @@ RUN set -eux; \
--with-pdo-mysql \
--with-zlib \
--enable-mbstring \
--with-openssl=/usr \
--with-libdir=lib/x86_64-linux-gnu \
; \
make -j"$(nproc)"; \
make install; \
Expand All @@ -40,11 +50,15 @@ RUN set -eux; \
bison \
libbison-dev \
; \
apt-get purge -y --auto-remove \
apt-get purge -y --force-yes --auto-remove \
autoconf2.13 \
; \
rm -r /usr/src/php

CMD ["php", "-a"]

FROM php53

# Install APC PHP extension
#
RUN set -eux; \
Expand All @@ -54,4 +68,38 @@ RUN set -eux; \
\
rm -r /tmp/pear;

CMD ["php", "-a"]
# Install composer
#
RUN set -eux; \
composerVersion='1.10.27'; \
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
\
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
| sha256sum -cw --status; \
\
{ \
echo '#! /usr/bin/env php'; \
cat /usr/local/bin/composer-installer.php; \
} > /usr/local/bin/composer-installer; \
rm /usr/local/bin/composer-installer.php; \
chmod +x /usr/local/bin/composer-installer; \
\
composer-installer \
--disable-tls \
--version="${composerVersion}" \
--filename=composer \
--install-dir=/usr/local/bin \
; \
\
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
| sha256sum -cw --status; \
\
composer --version; \
\
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
git \
; \
rm -r /var/lib/apt/lists/*; \
:;
62 changes: 60 additions & 2 deletions .docker/php54/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
FROM php:5.4-cli

RUN set -eux; \
codename='jessie'; \
{ \
echo "deb http://archive.debian.org/debian ${codename} main"; \
echo "deb http://archive.debian.org/debian ${codename}-backports main"; \
echo "deb http://archive.debian.org/debian-security ${codename}/updates main"; \
} > /etc/apt/sources.list;

RUN set -eux; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
ca-certificates \
; \
\
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
:;

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring
Expand All @@ -19,16 +37,56 @@ RUN set -eux; \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --no-upgrade --no-install-recommends \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
pecl install memcache-${MEMCACHE_VERSION}; \
docker-php-ext-enable memcache; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
$buildDeps \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
rm -r /tmp/pear

# Install composer
#
RUN set -eux; \
composerVersion='1.10.27'; \
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
\
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
| sha256sum -cw --status; \
\
{ \
echo '#! /usr/bin/env php'; \
cat /usr/local/bin/composer-installer.php; \
} > /usr/local/bin/composer-installer; \
rm /usr/local/bin/composer-installer.php; \
chmod +x /usr/local/bin/composer-installer; \
\
composer-installer \
--disable-tls \
--version="${composerVersion}" \
--filename=composer \
--install-dir=/usr/local/bin \
; \
\
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
| sha256sum -cw --status; \
\
composer --version; \
\
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
git \
libzip-dev \
unzip \
; \
rm -r /var/lib/apt/lists/*; \
\
docker-php-ext-install zip; \
:;
62 changes: 60 additions & 2 deletions .docker/php55_71/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
ARG PHP_TAG
FROM php:${PHP_TAG}

RUN set -eux; \
codename='jessie'; \
{ \
echo "deb http://archive.debian.org/debian ${codename} main"; \
echo "deb http://archive.debian.org/debian ${codename}-backports main"; \
echo "deb http://archive.debian.org/debian-security ${codename}/updates main"; \
} > /etc/apt/sources.list;

RUN set -eux; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
ca-certificates \
; \
\
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
:;

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring
Expand All @@ -25,16 +43,56 @@ RUN set -eux; \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --no-upgrade --no-install-recommends \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
pecl install memcache-${MEMCACHE_VERSION}; \
docker-php-ext-enable memcache; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
$buildDeps \
; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
rm -r /tmp/pear

# Install composer
#
RUN set -eux; \
composerVersion='1.10.27'; \
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
\
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
| sha256sum -cw --status; \
\
{ \
echo '#! /usr/bin/env php'; \
cat /usr/local/bin/composer-installer.php; \
} > /usr/local/bin/composer-installer; \
rm /usr/local/bin/composer-installer.php; \
chmod +x /usr/local/bin/composer-installer; \
\
composer-installer \
--disable-tls \
--version="${composerVersion}" \
--filename=composer \
--install-dir=/usr/local/bin \
; \
\
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
| sha256sum -cw --status; \
\
composer --version; \
\
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
git \
libzip-dev \
unzip \
; \
rm -r /var/lib/apt/lists/*; \
\
docker-php-ext-install zip; \
:;
42 changes: 41 additions & 1 deletion .docker/php72_73/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN set -eux; \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --no-upgrade --no-install-recommends \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
Expand Down Expand Up @@ -54,3 +54,43 @@ RUN set -eux; \
\
file /bin/ls --mime | grep application/x-executable; \
:;

# Install composer
#
RUN set -eux; \
composerVersion='1.10.27'; \
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
\
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
| sha256sum -cw --status; \
\
{ \
echo '#! /usr/bin/env php'; \
cat /usr/local/bin/composer-installer.php; \
} > /usr/local/bin/composer-installer; \
rm /usr/local/bin/composer-installer.php; \
chmod +x /usr/local/bin/composer-installer; \
\
composer-installer \
--disable-tls \
--version="${composerVersion}" \
--filename=composer \
--install-dir=/usr/local/bin \
; \
\
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
| sha256sum -cw --status; \
\
composer --version; \
\
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
git \
libzip-dev \
unzip \
; \
rm -r /var/lib/apt/lists/*; \
\
docker-php-ext-install zip; \
:;
46 changes: 43 additions & 3 deletions .docker/php74_83/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN docker-php-ext-install pdo_mysql
#
RUN set -eux; \
apt-get update; \
apt-get install -y --no-upgrade --no-install-recommends \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
libonig-dev \
; \
\
Expand Down Expand Up @@ -37,14 +37,14 @@ RUN set -eux; \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --no-upgrade --no-install-recommends \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
pecl install memcache-${MEMCACHE_VERSION}; \
docker-php-ext-enable memcache; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
$buildDeps \
; \
apt-get clean; \
Expand All @@ -66,3 +66,43 @@ RUN set -eux; \
\
file /bin/ls --mime | grep application/x-executable; \
:;

# Install composer
#
RUN set -eux; \
composerVersion='1.10.27'; \
installerUrl='https://raw.githubusercontent.com/composer/getcomposer.org/a19025d6c0a1ff9fc1fac341128b2823193be462/web/installer'; \
\
curl --insecure -sSLf "${installerUrl}" -o /usr/local/bin/composer-installer.php; \
echo '203196aedb1a3b0f563363796bbf6f647a4f8c2419bc1dfc5aa45adc1725025d /usr/local/bin/composer-installer.php' \
| sha256sum -cw --status; \
\
{ \
echo '#! /usr/bin/env php'; \
cat /usr/local/bin/composer-installer.php; \
} > /usr/local/bin/composer-installer; \
rm /usr/local/bin/composer-installer.php; \
chmod +x /usr/local/bin/composer-installer; \
\
composer-installer \
--disable-tls \
--version="${composerVersion}" \
--filename=composer \
--install-dir=/usr/local/bin \
; \
\
echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /usr/local/bin/composer' \
| sha256sum -cw --status; \
\
composer --version; \
\
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
git \
libzip-dev \
unzip \
; \
rm -r /var/lib/apt/lists/*; \
\
docker-php-ext-install zip; \
:;
6 changes: 4 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

[.github/**.yml]
[*.yml]
indent_size = 2

[Dockerfile]
indent_size = 2
indent_style = space
Loading

0 comments on commit 12dddb0

Please sign in to comment.