From ad0460c11069a558697d2e942a197c16edc8b6ad Mon Sep 17 00:00:00 2001 From: Laetitia Fesselier Date: Tue, 29 Nov 2022 10:54:19 -0500 Subject: [PATCH] [Tests] php install failure (Docker) (#8239) Fix Docker image when run locally GitHub Actions replaces the PHP version in the docker image, but the default version is too old to run LORIS when not replaced by GitHub Actions. This upgrades the default version so that tests can be run locally without modifying the Docker image. --- Dockerfile.test.php7.debug | 12 ------------ Dockerfile.test.php8 | 2 +- Dockerfile.test.php8.debug | 13 +++++++++++++ docker-compose.yml | 6 +++--- 4 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 Dockerfile.test.php7.debug create mode 100644 Dockerfile.test.php8.debug diff --git a/Dockerfile.test.php7.debug b/Dockerfile.test.php7.debug deleted file mode 100644 index d49ba66aae5..00000000000 --- a/Dockerfile.test.php7.debug +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4 - -RUN apt-get update && \ - apt-get install -y mariadb-client zlib1g-dev - -RUN yes | pecl install xdebug-2.8.0 -RUN echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini -RUN echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini -RUN echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini - -# Install extensions through the scripts the container provides -RUN docker-php-ext-install pdo_mysql zip diff --git a/Dockerfile.test.php8 b/Dockerfile.test.php8 index 3d4a1018898..c17dae4ad6e 100644 --- a/Dockerfile.test.php8 +++ b/Dockerfile.test.php8 @@ -1,4 +1,4 @@ -FROM php:8.0 +FROM php:8.1 RUN apt-get update && \ apt-get install -y mariadb-client libzip-dev diff --git a/Dockerfile.test.php8.debug b/Dockerfile.test.php8.debug new file mode 100644 index 00000000000..f1d0413beff --- /dev/null +++ b/Dockerfile.test.php8.debug @@ -0,0 +1,13 @@ +FROM php:8.1 + +RUN apt-get update && \ + apt-get install -y mariadb-client libzip-dev + +RUN yes | pecl install xdebug-3.1.0 +RUN echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini +RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini +RUN echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/xdebug.ini + +# Install extensions through the scripts the container provides +RUN apt-get install -y libzip-dev zip && \ + docker-php-ext-install pdo_mysql zip diff --git a/docker-compose.yml b/docker-compose.yml index aca1bfd613b..36f6a6d60c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,7 +73,7 @@ services: web-debug: build: context: . - dockerfile: Dockerfile.test.php7.debug + dockerfile: Dockerfile.test.php8.debug volumes: - ./:/app - ./test/test_instrument:/app/project/instruments @@ -88,7 +88,7 @@ services: unit-tests-debug: build: context: . - dockerfile: Dockerfile.test.php7.debug + dockerfile: Dockerfile.test.php8.debug volumes: - ./:/app working_dir: /app @@ -103,7 +103,7 @@ services: integration-tests-debug: build: context: . - dockerfile: Dockerfile.test.php7.debug + dockerfile: Dockerfile.test.php8.debug volumes: - ./:/app working_dir: /app