Skip to content

Commit

Permalink
fixup! 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 d047a51 commit 3eef9e5
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 36 deletions.
44 changes: 41 additions & 3 deletions .docker/php53/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM buildpack-deps:jessie
FROM buildpack-deps:jessie as php53

ENV PHP_VERSION 5.3.29

Expand All @@ -14,7 +14,7 @@ RUN set -eux; \
RUN set -eux; \
\
apt-get update; \
apt-get install -y --force-yes \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
curl \
autoconf2.13 \
; \
Expand Down Expand Up @@ -55,6 +55,10 @@ RUN set -eux; \
; \
rm -r /usr/src/php

CMD ["php", "-a"]

FROM php53

# Install APC PHP extension
#
RUN set -eux; \
Expand All @@ -64,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/*; \
:;
40 changes: 40 additions & 0 deletions .docker/php54/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,43 @@ RUN set -eux; \
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; \
:;
40 changes: 40 additions & 0 deletions .docker/php55_71/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,43 @@ RUN set -eux; \
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; \
:;
40 changes: 40 additions & 0 deletions .docker/php72_73/Dockerfile
Original file line number Diff line number Diff line change
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; \
:;
40 changes: 40 additions & 0 deletions .docker/php74_82/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 3 additions & 7 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#
# Environment variables used by docker-compose for test.
# Environment variables used by for running tests.
#
# Copy to `.env` in order to use it.
#

# APC test are disabled.
#
# To enable them in order to provide a fix, set to "on".
# Copy to `.env` in order to customize it.
#
DOCKER_COMPOSE='docker-compose'
APC_ENABLE_CLI=off
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ lib/plugins/sfDoctrinePlugin/test/functional/fixtures/log/
/vendor
/composer.lock
.php-cs-fixer.cache
/var/
/.env
19 changes: 3 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,14 @@ volumes:
db_socket:

services:
composer:
image: composer:1
working_dir: /app
volumes:
- .:/app
entrypoint:
- sh
- -c
- |
exec tail -f /dev/null
php53:
build: .docker/php53
working_dir: /app
volumes:
- .:/app
- db_socket:/var/run/mysqld
environment:
COMPOSER_HOME: /app/var/cache/composer
entrypoint:
- sh
- -c
Expand All @@ -46,6 +37,7 @@ services:
MEMCACHE_VERSION: '3.0.8'
environment:
MEMCACHED_HOST: memcached
COMPOSER_HOME: /app/var/cache/composer
working_dir: /app
volumes:
- .:/app
Expand Down Expand Up @@ -105,7 +97,6 @@ services:
MEMCACHE_VERSION: '4.0.5.2'
APCU_VERSION: ''


php72:
<<: *services_php54
build:
Expand All @@ -115,7 +106,6 @@ services:
MEMCACHE_VERSION: '4.0.5.2'
APCU_VERSION: ''


php73:
<<: *services_php54
build:
Expand All @@ -125,7 +115,6 @@ services:
MEMCACHE_VERSION: '4.0.5.2'
APCU_VERSION: ''


php74:
<<: *services_php54
build:
Expand All @@ -135,7 +124,6 @@ services:
MEMCACHE_VERSION: '4.0.5.2'
APCU_VERSION: ''


php80:
<<: *services_php54
build:
Expand All @@ -145,7 +133,6 @@ services:
MEMCACHE_VERSION: '8.0'
APCU_VERSION: ''


php81:
<<: *services_php54
build:
Expand Down
Loading

0 comments on commit 3eef9e5

Please sign in to comment.