From 1f16fe6003e8c599ec82ee7a606d2e46699e789c Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 13 May 2021 22:41:58 +0200 Subject: [PATCH 1/5] Update PHP CI images --- php7.3/Dockerfile | 22 ++++++++++++++++------ php7.4/Dockerfile | 30 ++++++++++++++++++++++++++++++ php7.4/php.ini | 10 ++++++++++ php8.0/Dockerfile | 30 ++++++++++++++++++++++++++++++ php8.0/php.ini | 10 ++++++++++ 5 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 php7.4/Dockerfile create mode 100644 php7.4/php.ini create mode 100644 php8.0/Dockerfile create mode 100644 php8.0/php.ini diff --git a/php7.3/Dockerfile b/php7.3/Dockerfile index b2f86bc..4d4f741 100644 --- a/php7.3/Dockerfile +++ b/php7.3/Dockerfile @@ -1,20 +1,30 @@ -FROM debian:jessie +FROM debian:buster # install the PHP extensions we need # see https://friendi.ca/resources/requirements/ RUN set -ex; \ apt-get update; \ - apt-get install -y wget gnupg2 libzip2 apt-transport-https lsb-release ca-certificates; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates; \ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; \ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list; \ apt-get update; \ - apt-get install -y php7.3-gd git curl openssl \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y php7.3-gd git curl openssl \ php7.3-cli php7.3-curl php7.3-mysql wget make \ php7.3-redis php7.3-memcached php7.3-memcache php7.3-json \ - php7.3-apcu php7.3-xdebug php7.3-xml php7.3-zip php7.3-dev php7.3-mbstring \ - ; \ + php7.3-apcu php7.3-xdebug php7.3-xml php7.3-zip php7.3-dev php7.3-mbstring; \ + apt-get autoremove -y; apt-get autoclean; apt-get clean; \ rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*; RUN phpenmod curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv pcntl openssl + +RUN set -ex; \ + curl -O -L https://phar.phpunit.de/phpunit-8.phar; \ + chmod +x phpunit-8.phar; \ + mv phpunit-8.phar /usr/local/bin/phpunit; +RUN set -ex; \ + curl -O -L https://getcomposer.org/download/1.6.2/composer.phar; \ + chmod +x composer.phar; \ + mv composer.phar /usr/local/bin/composer; + RUN phpdismod xdebug -ADD php.ini /etc/php/7.1/cli/conf.d/friendica.ini \ No newline at end of file +ADD php.ini /etc/php/7.3/cli/conf.d/friendica.ini \ No newline at end of file diff --git a/php7.4/Dockerfile b/php7.4/Dockerfile new file mode 100644 index 0000000..47afd9c --- /dev/null +++ b/php7.4/Dockerfile @@ -0,0 +1,30 @@ +FROM debian:buster + +# install the PHP extensions we need +# see https://friendi.ca/resources/requirements/ +RUN set -ex; \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates; \ + wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; \ + echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list; \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y php7.4-gd git curl openssl \ + php7.4-cli php7.4-curl php7.4-mysql wget make \ + php7.4-redis php7.4-memcached php7.4-memcache php7.4-json \ + php7.4-apcu php7.4-xdebug php7.4-xml php7.4-zip php7.4-dev php7.4-mbstring; \ + apt-get autoremove -y; apt-get autoclean; apt-get clean; \ + rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*; + +RUN phpenmod curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype json iconv pcntl openssl + +RUN set -ex; \ + curl -O -L https://phar.phpunit.de/phpunit-8.phar; \ + chmod +x phpunit-8.phar; \ + mv phpunit-8.phar /usr/local/bin/phpunit; +RUN set -ex; \ + curl -O -L https://getcomposer.org/download/1.6.2/composer.phar; \ + chmod +x composer.phar; \ + mv composer.phar /usr/local/bin/composer; + +RUN phpdismod xdebug +ADD php.ini /etc/php/7.4/cli/conf.d/friendica.ini \ No newline at end of file diff --git a/php7.4/php.ini b/php7.4/php.ini new file mode 100644 index 0000000..97888e9 --- /dev/null +++ b/php7.4/php.ini @@ -0,0 +1,10 @@ +memory_limit = 768M +phar.readonly = 0 ; only for building phar files on CI - should be disabled on production environments +; Opcache +opcache.enable=1 +opcache.enable_cli=1 +opcache.interned_strings_buffer=8 +opcache.max_accelerated_files=10000 +opcache.memory_consumption=128 +opcache.save_comments=1 +opcache.revalidate_freq=1 \ No newline at end of file diff --git a/php8.0/Dockerfile b/php8.0/Dockerfile new file mode 100644 index 0000000..27c4ea2 --- /dev/null +++ b/php8.0/Dockerfile @@ -0,0 +1,30 @@ +FROM debian:buster + +# install the PHP extensions we need +# see https://friendi.ca/resources/requirements/ +RUN set -ex; \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates; \ + wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; \ + echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list; \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y php8.0-gd git curl openssl \ + php8.0-cli php8.0-curl php8.0-mysql wget make \ + php8.0-redis php8.0-memcached php8.0-memcache \ + php8.0-apcu php8.0-xdebug php8.0-xml php8.0-zip php8.0-dev php8.0-mbstring; \ + apt-get autoremove -y; apt-get autoclean; apt-get clean; \ + rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*; + +RUN phpenmod curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype iconv pcntl openssl + +RUN set -ex; \ + curl -O -L https://phar.phpunit.de/phpunit-9.4.4.phar; \ + chmod +x phpunit-9.4.4.phar; \ + mv phpunit-9.4.4.phar /usr/local/bin/phpunit; +RUN set -ex; \ + curl -O -L https://getcomposer.org/download/1.10.15/composer.phar; \ + chmod +x composer.phar; \ + mv composer.phar /usr/local/bin/composer; + +RUN phpdismod xdebug +ADD php.ini /etc/php/8.0/cli/conf.d/friendica.ini \ No newline at end of file diff --git a/php8.0/php.ini b/php8.0/php.ini new file mode 100644 index 0000000..97888e9 --- /dev/null +++ b/php8.0/php.ini @@ -0,0 +1,10 @@ +memory_limit = 768M +phar.readonly = 0 ; only for building phar files on CI - should be disabled on production environments +; Opcache +opcache.enable=1 +opcache.enable_cli=1 +opcache.interned_strings_buffer=8 +opcache.max_accelerated_files=10000 +opcache.memory_consumption=128 +opcache.save_comments=1 +opcache.revalidate_freq=1 \ No newline at end of file From 8eb8360f9e604cf364931b39dd34f34f608183e2 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 13 May 2021 22:42:33 +0200 Subject: [PATCH 2/5] Add EOF --- php7.3/Dockerfile | 2 +- php7.4/Dockerfile | 2 +- php8.0/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php7.3/Dockerfile b/php7.3/Dockerfile index 4d4f741..faad2ca 100644 --- a/php7.3/Dockerfile +++ b/php7.3/Dockerfile @@ -27,4 +27,4 @@ RUN set -ex; \ mv composer.phar /usr/local/bin/composer; RUN phpdismod xdebug -ADD php.ini /etc/php/7.3/cli/conf.d/friendica.ini \ No newline at end of file +ADD php.ini /etc/php/7.3/cli/conf.d/friendica.ini diff --git a/php7.4/Dockerfile b/php7.4/Dockerfile index 47afd9c..54d5e30 100644 --- a/php7.4/Dockerfile +++ b/php7.4/Dockerfile @@ -27,4 +27,4 @@ RUN set -ex; \ mv composer.phar /usr/local/bin/composer; RUN phpdismod xdebug -ADD php.ini /etc/php/7.4/cli/conf.d/friendica.ini \ No newline at end of file +ADD php.ini /etc/php/7.4/cli/conf.d/friendica.ini diff --git a/php8.0/Dockerfile b/php8.0/Dockerfile index 27c4ea2..dc65380 100644 --- a/php8.0/Dockerfile +++ b/php8.0/Dockerfile @@ -27,4 +27,4 @@ RUN set -ex; \ mv composer.phar /usr/local/bin/composer; RUN phpdismod xdebug -ADD php.ini /etc/php/8.0/cli/conf.d/friendica.ini \ No newline at end of file +ADD php.ini /etc/php/8.0/cli/conf.d/friendica.ini From 34b5db431f277230d31b13b1ebd4351b8f20ed6b Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 13 May 2021 22:44:14 +0200 Subject: [PATCH 3/5] Add EOF --- php7.3/php.ini | 2 +- php7.4/php.ini | 2 +- php8.0/php.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php7.3/php.ini b/php7.3/php.ini index 97888e9..a7980f3 100644 --- a/php7.3/php.ini +++ b/php7.3/php.ini @@ -7,4 +7,4 @@ opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 -opcache.revalidate_freq=1 \ No newline at end of file +opcache.revalidate_freq=1 diff --git a/php7.4/php.ini b/php7.4/php.ini index 97888e9..a7980f3 100644 --- a/php7.4/php.ini +++ b/php7.4/php.ini @@ -7,4 +7,4 @@ opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 -opcache.revalidate_freq=1 \ No newline at end of file +opcache.revalidate_freq=1 diff --git a/php8.0/php.ini b/php8.0/php.ini index 97888e9..a7980f3 100644 --- a/php8.0/php.ini +++ b/php8.0/php.ini @@ -7,4 +7,4 @@ opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 -opcache.revalidate_freq=1 \ No newline at end of file +opcache.revalidate_freq=1 From d84f6e382fd8bf7f11da9f758c332256769bd81e Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 13 May 2021 23:22:29 +0200 Subject: [PATCH 4/5] Add mariadb-client for "mysqladmin" command --- php7.3/Dockerfile | 2 +- php7.4/Dockerfile | 2 +- php8.0/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php7.3/Dockerfile b/php7.3/Dockerfile index faad2ca..8c5be29 100644 --- a/php7.3/Dockerfile +++ b/php7.3/Dockerfile @@ -4,7 +4,7 @@ FROM debian:buster # see https://friendi.ca/resources/requirements/ RUN set -ex; \ apt-get update; \ - DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates mariadb-client; \ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; \ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list; \ apt-get update; \ diff --git a/php7.4/Dockerfile b/php7.4/Dockerfile index 54d5e30..e183bc0 100644 --- a/php7.4/Dockerfile +++ b/php7.4/Dockerfile @@ -4,7 +4,7 @@ FROM debian:buster # see https://friendi.ca/resources/requirements/ RUN set -ex; \ apt-get update; \ - DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates mariadb-client; \ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; \ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list; \ apt-get update; \ diff --git a/php8.0/Dockerfile b/php8.0/Dockerfile index dc65380..816c8db 100644 --- a/php8.0/Dockerfile +++ b/php8.0/Dockerfile @@ -4,7 +4,7 @@ FROM debian:buster # see https://friendi.ca/resources/requirements/ RUN set -ex; \ apt-get update; \ - DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates; \ + DEBIAN_FRONTEND=noninteractive apt-get install -q -y wget gnupg2 apt-transport-https lsb-release ca-certificates mariadb-client; \ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; \ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list; \ apt-get update; \ From 2c59bedb2aa18f0b58fe2a1444ef4faee8ee9d31 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 15 May 2021 23:58:29 +0200 Subject: [PATCH 5/5] Adjusting settings & step back to PHPUnit 8 because of incompatible tests --- php7.3/php.ini | 2 ++ php7.4/php.ini | 2 ++ php8.0/Dockerfile | 6 +++--- php8.0/php.ini | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/php7.3/php.ini b/php7.3/php.ini index a7980f3..aec4419 100644 --- a/php7.3/php.ini +++ b/php7.3/php.ini @@ -8,3 +8,5 @@ opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1 +apc.enabled=1 +apc.enable_cli=1 diff --git a/php7.4/php.ini b/php7.4/php.ini index a7980f3..aec4419 100644 --- a/php7.4/php.ini +++ b/php7.4/php.ini @@ -8,3 +8,5 @@ opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1 +apc.enabled=1 +apc.enable_cli=1 diff --git a/php8.0/Dockerfile b/php8.0/Dockerfile index 816c8db..f5f8b16 100644 --- a/php8.0/Dockerfile +++ b/php8.0/Dockerfile @@ -18,9 +18,9 @@ RUN set -ex; \ RUN phpenmod curl pdo pdo_mysql xml gd zip opcache mbstring posix ctype iconv pcntl openssl RUN set -ex; \ - curl -O -L https://phar.phpunit.de/phpunit-9.4.4.phar; \ - chmod +x phpunit-9.4.4.phar; \ - mv phpunit-9.4.4.phar /usr/local/bin/phpunit; + curl -O -L https://phar.phpunit.de/phpunit-8.phar; \ + chmod +x phpunit-8.phar; \ + mv phpunit-8.phar /usr/local/bin/phpunit; RUN set -ex; \ curl -O -L https://getcomposer.org/download/1.10.15/composer.phar; \ chmod +x composer.phar; \ diff --git a/php8.0/php.ini b/php8.0/php.ini index a7980f3..aec4419 100644 --- a/php8.0/php.ini +++ b/php8.0/php.ini @@ -8,3 +8,5 @@ opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1 +apc.enabled=1 +apc.enable_cli=1