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 Nov 18, 2023
1 parent 2826410 commit 8b745c9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
16 changes: 13 additions & 3 deletions .docker/php53/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ FROM buildpack-deps:jessie

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 \
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,7 +50,7 @@ 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
Expand Down
11 changes: 9 additions & 2 deletions .docker/php54/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
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-security ${codename}/updates main"; \
} > /etc/apt/sources.list;

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring
Expand All @@ -19,14 +26,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 Down
11 changes: 9 additions & 2 deletions .docker/php55_71/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
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-security ${codename}/updates main"; \
} > /etc/apt/sources.list;

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring
Expand All @@ -25,14 +32,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 Down
2 changes: 1 addition & 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
6 changes: 3 additions & 3 deletions .docker/php74_82/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 Down

0 comments on commit 8b745c9

Please sign in to comment.