Skip to content

Commit

Permalink
fix(test): make php 5.3 consistent with others
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Jan 1, 2024
1 parent 1322fa4 commit 12a5214
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 59 deletions.
67 changes: 59 additions & 8 deletions .docker/php53/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ RUN set -eux; \

# php 5.3 needs older autoconf
RUN set -eux; \
\
buildDeps=' \
autoconf2.13 \
'; \
\
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
curl \
autoconf2.13 \
$buildDeps \
; \
rm -r /var/lib/apt/lists/*; \
\
Expand All @@ -37,36 +41,83 @@ RUN set -eux; \
./buildconf --force; \
./configure --disable-cgi \
$(command -v apxs2 > /dev/null 2>&1 && echo '--with-apxs2' || true) \
--with-config-file-path=/usr/local/etc/php \
--with-config-file-scan-dir=/usr/local/etc/php/conf.d \
--with-libdir=lib/x86_64-linux-gnu \
--with-pdo-mysql \
--with-zlib \
--enable-zip \
--enable-mbstring \
--with-openssl=/usr \
--with-libdir=lib/x86_64-linux-gnu \
--enable-mysqlnd \
--with-curl \
--with-readline \
--enable-ftp \
; \
make -j"$(nproc)"; \
make install; \
install -d /usr/local/etc/php/conf.d; \
\
dpkg -r \
bison \
libbison-dev \
; \
apt-get purge -y --force-yes --auto-remove \
autoconf2.13 \
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
$buildDeps \
; \
rm -r /usr/src/php
rm -r /usr/src/php; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
rm -r /tmp/pear; \
:;

RUN set -eux; \
{ \
echo '#! /bin/sh -eu'; \
echo ''; \
echo 'echo "extension=${1}.so" > "/usr/local/etc/php/conf.d/docker-php-ext-${1}.ini";'; \
} | tee /usr/local/bin/docker-php-ext-enable; \
\
chmod +x /usr/local/bin/docker-php-ext-enable; \
:;

CMD ["php", "-a"]

FROM php53

# Install APC PHP extension
#
ARG APC_VERSION
RUN set -eux; \
\
test x"" = x"${APC_VERSION}" || { \
pecl install "apc-${APC_VERSION}"; \
docker-php-ext-enable apc; \
\
rm -r /tmp/pear; \
}

# Install memcache PHP extension
#
ARG MEMCACHE_VERSION
RUN set -eux; \
buildDeps=' \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
pecl install apc-3.1.13; \
echo 'extension=apc.so' >> /usr/local/lib/php.ini; \
pecl install "memcache-${MEMCACHE_VERSION}"; \
docker-php-ext-enable memcache; \
\
rm -r /tmp/pear;
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
#
Expand Down
13 changes: 9 additions & 4 deletions .docker/php54/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ RUN docker-php-ext-install mbstring

# Install APC PHP extension
#
ARG APC_VERSION
RUN set -eux; \
pecl install apc-3.1.13; \
docker-php-ext-enable apc; \
rm -r /tmp/pear;
\
test x"" = x"${APC_VERSION}" || { \
pecl install "apc-${APC_VERSION}"; \
docker-php-ext-enable apc; \
\
rm -r /tmp/pear; \
}

# Install memcache PHP extension
#
Expand All @@ -41,7 +46,7 @@ RUN set -eux; \
$buildDeps \
; \
\
pecl install memcache-${MEMCACHE_VERSION}; \
pecl install "memcache-${MEMCACHE_VERSION}"; \
docker-php-ext-enable memcache; \
\
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
Expand Down
4 changes: 2 additions & 2 deletions .docker/php55_71/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ARG APCU_VERSION
RUN set -eux; \
\
test x"" = x"${APCU_VERSION}" || { \
pecl install apcu-${APCU_VERSION}; \
pecl install "apcu-${APCU_VERSION}"; \
docker-php-ext-enable apcu; \
\
rm -r /tmp/pear; \
Expand All @@ -47,7 +47,7 @@ RUN set -eux; \
$buildDeps \
; \
\
pecl install memcache-${MEMCACHE_VERSION}; \
pecl install "memcache-${MEMCACHE_VERSION}"; \
docker-php-ext-enable memcache; \
\
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
Expand Down
4 changes: 2 additions & 2 deletions .docker/php72_73/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG APCU_VERSION
RUN set -eux; \
\
test x"" = x"${APCU_VERSION}" || { \
pecl install apcu-${APCU_VERSION}; \
pecl install "apcu-${APCU_VERSION}"; \
docker-php-ext-enable apcu; \
\
rm -r /tmp/pear; \
Expand All @@ -29,7 +29,7 @@ RUN set -eux; \
$buildDeps \
; \
\
pecl install memcache-${MEMCACHE_VERSION}; \
pecl install "memcache-${MEMCACHE_VERSION}"; \
docker-php-ext-enable memcache; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
Expand Down
4 changes: 2 additions & 2 deletions .docker/php74_83/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ARG APCU_VERSION
RUN set -eux; \
\
test x"" = x"${APCU_VERSION}" || { \
pecl install apcu-${APCU_VERSION}; \
pecl install "apcu-${APCU_VERSION}"; \
docker-php-ext-enable apcu; \
\
rm -r /tmp/pear; \
Expand All @@ -41,7 +41,7 @@ RUN set -eux; \
$buildDeps \
; \
\
pecl install memcache-${MEMCACHE_VERSION}; \
pecl install "memcache-${MEMCACHE_VERSION}"; \
docker-php-ext-enable memcache; \
\
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
Expand Down
65 changes: 24 additions & 41 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ volumes:
db_socket:

services:
php53:
build: .docker/php53
php53: &services_php
build:
context: .docker/php53
args:
MEMCACHE_VERSION: '3.0.8'
APC_VERSION: '3.1.13'
working_dir: /app
volumes:
- .:/app
- db_socket:/var/run/mysqld
environment:
COMPOSER_HOME: /app/var/cache/composer
MEMCACHED_HOST: memcached
entrypoint:
- sh
- -c
Expand All @@ -23,46 +28,24 @@ services:
echo 'magic_quotes_gpc = off'
echo 'date.timezone = "UTC"'
echo 'apc.enable_cli = ${APC_ENABLE_CLI-off}'
echo 'apc.use_request_time = 0'
} | tee -a /usr/local/lib/php.ini
echo 'apc.use_request_time = off'
} | tee -a /usr/local/etc/php/php.ini
exec tail -f /dev/null
depends_on:
- db
- memcached

php54: &services_php54
php54:
<<: *services_php
build:
context: .docker/php54
args:
MEMCACHE_VERSION: '3.0.8'
environment:
MEMCACHED_HOST: memcached
COMPOSER_HOME: /app/var/cache/composer
working_dir: /app
volumes:
- .:/app
- db_socket:/var/run/mysqld
entrypoint:
- sh
- -c
- |
{
echo 'pdo_mysql.default_socket = /var/run/mysqld/mysql.sock'
echo 'memory_limit = -1'
echo 'short_open_tag = off'
echo 'magic_quotes_gpc = off'
echo 'date.timezone = "UTC"'
echo 'apc.enable_cli = ${APC_ENABLE_CLI-off}'
echo 'apc.use_request_time = 0'
} | tee -a /usr/local/etc/php/php.ini
exec tail -f /dev/null
depends_on:
- db
- memcached
APC_VERSION: '3.1.13'

php55:
<<: *services_php54
<<: *services_php
build:
context: .docker/php55_71
args:
Expand All @@ -71,7 +54,7 @@ services:
APCU_VERSION: '4.0.11'

php56:
<<: *services_php54
<<: *services_php
build:
context: .docker/php55_71
args:
Expand All @@ -80,7 +63,7 @@ services:
APCU_VERSION: '4.0.11'

php70:
<<: *services_php54
<<: *services_php
build:
context: .docker/php55_71
args:
Expand All @@ -89,7 +72,7 @@ services:
APCU_VERSION: ''

php71:
<<: *services_php54
<<: *services_php
build:
context: .docker/php55_71
args:
Expand All @@ -98,7 +81,7 @@ services:
APCU_VERSION: ''

php72:
<<: *services_php54
<<: *services_php
build:
context: .docker/php72_73
args:
Expand All @@ -107,7 +90,7 @@ services:
APCU_VERSION: ''

php73:
<<: *services_php54
<<: *services_php
build:
context: .docker/php72_73
args:
Expand All @@ -116,7 +99,7 @@ services:
APCU_VERSION: ''

php74:
<<: *services_php54
<<: *services_php
build:
context: .docker/php74_83
args:
Expand All @@ -125,7 +108,7 @@ services:
APCU_VERSION: ''

php80:
<<: *services_php54
<<: *services_php
build:
context: .docker/php74_83
args:
Expand All @@ -134,7 +117,7 @@ services:
APCU_VERSION: ''

php81:
<<: *services_php54
<<: *services_php
build:
context: .docker/php74_83
args:
Expand All @@ -143,7 +126,7 @@ services:
APCU_VERSION: ''

php82:
<<: *services_php54
<<: *services_php
build:
context: .docker/php74_83
args:
Expand All @@ -152,7 +135,7 @@ services:
APCU_VERSION: ''

php83:
<<: *services_php54
<<: *services_php
build:
context: .docker/php74_83
args:
Expand Down

0 comments on commit 12a5214

Please sign in to comment.