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 20, 2024
1 parent ba4ef22 commit d2dcf7b
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 112 deletions.
95 changes: 85 additions & 10 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,38 +41,67 @@ 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; \
\
packageName=APC; \
packageVersion=3.1.13; \
packageName=apc; \
packageVersion=${APC_VERSION}; \
packageFile=APC-${packageVersion}.tgz; \
\
packageFile=${packageName}-${packageVersion}.tgz; \
if test x"3.1.13" = x"${packageVersion}"; then \
packageSha256sum=5ef8ba07729e72946e95951672a5378bed98cb5a294e79bf0f0a97ac62829abd; \
else :; fi; \
\
packageSha256sum=5ef8ba07729e72946e95951672a5378bed98cb5a294e79bf0f0a97ac62829abd; \
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
Expand All @@ -77,11 +110,53 @@ RUN set -eux; \
pecl install ${packageFile}; \
rm ${packageFile}; \
\
echo "extension=apc.so" >> /usr/local/lib/php.ini; \
docker-php-ext-enable ${packageName}; \
\
rm -r /tmp/pear; \
:;

# Install memcache PHP extension
#
ARG MEMCACHE_VERSION
RUN set -eux; \
\
packageName=memcache; \
packageVersion=${MEMCACHE_VERSION}; \
packageFile=${packageName}-${packageVersion}.tgz; \
\
if test x"3.0.8" = x"${packageVersion}"; then \
packageSha256sum=2cae5b423ffbfd33a259829849f6000d4db018debe3e29ecf3056f06642e8311; \
else :; fi; \
\
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
buildDeps=' \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
| sha256sum -cw --status; \
\
pecl install ${packageFile}; \
rm ${packageFile}; \
\
docker-php-ext-enable ${packageName}; \
\
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; \
Expand Down
40 changes: 28 additions & 12 deletions .docker/php54/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@ RUN docker-php-ext-install mbstring

# Install APC PHP extension
#
ARG APC_VERSION
RUN set -eux; \
\
packageName=APC; \
packageVersion=3.1.13; \
packageName=apc; \
packageVersion=${APC_VERSION}; \
packageFile=APC-${packageVersion}.tgz; \
\
packageFile=${packageName}-${packageVersion}.tgz; \
if test x"3.1.13" = x"${packageVersion}"; then \
packageSha256sum=5ef8ba07729e72946e95951672a5378bed98cb5a294e79bf0f0a97ac62829abd; \
else :; fi; \
\
packageSha256sum=5ef8ba07729e72946e95951672a5378bed98cb5a294e79bf0f0a97ac62829abd; \
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
Expand All @@ -40,7 +47,7 @@ RUN set -eux; \
pecl install ${packageFile}; \
rm ${packageFile}; \
\
echo "extension=apc.so" >> /usr/local/lib/php.ini; \
docker-php-ext-enable ${packageName}; \
\
rm -r /tmp/pear; \
:;
Expand All @@ -50,10 +57,19 @@ RUN set -eux; \
ARG MEMCACHE_VERSION
RUN set -eux; \
\
if test x"3.0.8" = x"${MEMCACHE_VERSION}"; then \
packageSha256sum=2cae5b423ffbfd33a259829849f6000d4db018debe3e29ecf3056f06642e8311; \
packageName=memcache; \
packageVersion=${MEMCACHE_VERSION}; \
packageFile=${packageName}-${packageVersion}.tgz; \
\
if test x"3.0.8" = x"${packageVersion}"; then \
packageSha256sum=2cae5b423ffbfd33a259829849f6000d4db018debe3e29ecf3056f06642e8311; \
else :; fi; \
\
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
buildDeps=' \
libzip-dev \
'; \
Expand All @@ -62,14 +78,14 @@ RUN set -eux; \
$buildDeps \
; \
\
curl --insecure -sSLfO https://pecl.php.net/get/memcache-${MEMCACHE_VERSION}.tgz; \
echo "${packageSha256sum} memcache-${MEMCACHE_VERSION}.tgz" \
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
| sha256sum -cw --status; \
\
pecl install memcache-${MEMCACHE_VERSION}.tgz; \
rm memcache-${MEMCACHE_VERSION}.tgz; \
pecl install ${packageFile}; \
rm ${packageFile}; \
\
docker-php-ext-enable memcache; \
docker-php-ext-enable ${packageName}; \
\
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
$buildDeps \
Expand Down
39 changes: 22 additions & 17 deletions .docker/php55_71/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,9 @@ RUN docker-php-ext-install mbstring
#
ARG APCU_VERSION
RUN set -eux; \
\
if test x"" = x"${APCU_VERSION}"; then \
return 0; \
else :; fi; \
\
packageName=apcu; \
packageVersion=${APCU_VERSION}; \
\
packageFile=${packageName}-${packageVersion}.tgz; \
\
if test x"4.0.11" = x"${packageVersion}"; then \
Expand All @@ -45,6 +40,11 @@ RUN set -eux; \
packageSha256sum=67ee7464ccad2335c3fa4aeb0b8edbcf6d8344feea7922620c6a13015d604482; \
else :; fi; \
\
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
| sha256sum -cw --status; \
Expand All @@ -61,27 +61,32 @@ RUN set -eux; \
#
ARG MEMCACHE_VERSION
RUN set -eux; \
\
buildDeps=' \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
packageName=memcache; \
packageVersion=${MEMCACHE_VERSION}; \
\
packageFile=${packageName}-${packageVersion}.tgz; \
\
if test x"4.0.5.2" = x"${packageVersion}"; then \
packageSha256sum=7b7667813baea003671f174bbec849e43ff235a8ea4ab7e36c3a0380c2a9ed63; \
else :; fi; \
if test x"3.0.8" = x"${packageVersion}"; then \
packageSha256sum=2cae5b423ffbfd33a259829849f6000d4db018debe3e29ecf3056f06642e8311; \
else :; fi; \
\
if test x"4.0.5.2" = x"${packageVersion}"; then \
packageSha256sum=7b7667813baea003671f174bbec849e43ff235a8ea4ab7e36c3a0380c2a9ed63; \
else :; fi; \
\
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
buildDeps=' \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
| sha256sum -cw --status; \
Expand Down
34 changes: 19 additions & 15 deletions .docker/php72_73/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ RUN docker-php-ext-install mbstring
#
ARG APCU_VERSION
RUN set -eux; \
\
if test x"" = x"${APCU_VERSION}"; then \
return 0; \
else :; fi; \
\
packageName=apcu; \
packageVersion=${APCU_VERSION}; \
\
packageFile=${packageName}-${packageVersion}.tgz; \
\
if test x"5.1.23" = x"${packageVersion}"; then \
packageSha256sum=67ee7464ccad2335c3fa4aeb0b8edbcf6d8344feea7922620c6a13015d604482; \
else :; fi; \
\
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
| sha256sum -cw --status; \
Expand All @@ -39,24 +39,28 @@ RUN set -eux; \
#
ARG MEMCACHE_VERSION
RUN set -eux; \
\
buildDeps=' \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
packageName=memcache; \
packageVersion=${MEMCACHE_VERSION}; \
\
packageFile=${packageName}-${packageVersion}.tgz; \
\
if test x"4.0.5.2" = x"${packageVersion}"; then \
packageSha256sum=7b7667813baea003671f174bbec849e43ff235a8ea4ab7e36c3a0380c2a9ed63; \
else :; fi; \
\
if test x"" = x"${packageVersion}"; then \
echo "Skip installation of ${packageName} PHP extension"; \
return 0; \
fi; \
\
buildDeps=' \
libzip-dev \
'; \
apt-get update; \
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
$buildDeps \
; \
\
curl --insecure -sSLfO https://pecl.php.net/get/${packageFile}; \
echo "${packageSha256sum} ${packageFile}" \
| sha256sum -cw --status; \
Expand All @@ -66,7 +70,7 @@ RUN set -eux; \
\
docker-php-ext-enable ${packageName}; \
\
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
Loading

0 comments on commit d2dcf7b

Please sign in to comment.