From 97b3de492b4cf9f1b3842010be9eb0b009124dd9 Mon Sep 17 00:00:00 2001 From: Steven Pennington Date: Mon, 26 Feb 2024 20:36:47 -0700 Subject: [PATCH 1/4] add support for PHP 8.3 --- 8.3/Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 8.3/entrypoint.sh | 5 +++++ 2 files changed, 40 insertions(+) create mode 100644 8.3/Dockerfile create mode 100644 8.3/entrypoint.sh diff --git a/8.3/Dockerfile b/8.3/Dockerfile new file mode 100644 index 0000000..a6ca2ec --- /dev/null +++ b/8.3/Dockerfile @@ -0,0 +1,35 @@ +FROM kooldev/php:8.3 + +# make Composer global vendor/bin available through PATH +RUN echo "export PATH=\$PATH:\/root\/.composer\/vendor\/bin:\/phars/" | tee -a /etc/profile + +# install dependencies (ast) +RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ + && pecl install ast \ + && echo 'extension=ast.so' >> /usr/local/etc/php/php.ini \ + && docker-php-ext-enable xdebug \ + && apk del .build-deps \ + && rm -rf /var/cache/apk/* /tmp/* + +# install QA tools +RUN \ + # install and set up QA tools from Composer + composer global require squizlabs/php_codesniffer \ + phpstan/phpstan \ + friendsofphp/php-cs-fixer \ + phan/phan \ + # download PHAR and make them executable + && mkdir /phars \ + && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ + && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ + && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ + && chmod +x /phars/* \ + # post-install tools settings + && /phars/local-php-security-checker --update-cache + +ADD entrypoint.sh /kool/entrypoint.sh +RUN chmod +x /kool/entrypoint.sh + +ENTRYPOINT [ "/kool/entrypoint.sh" ] +CMD [ "composer", "--version" ] diff --git a/8.3/entrypoint.sh b/8.3/entrypoint.sh new file mode 100644 index 0000000..fd66291 --- /dev/null +++ b/8.3/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source /etc/profile + +exec "$@" From 373651470cfa4d90476ade34b6573875fc8f7287 Mon Sep 17 00:00:00 2001 From: Steven Pennington Date: Tue, 27 Feb 2024 08:00:08 -0700 Subject: [PATCH 2/4] add 8.3 to README and kool.yml --- README.md | 1 + kool.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index ba586df..17cefc4 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ docker run --rm --init -it -v $(pwd):/app -w /app kooldev/phpqa:7.4 The image built is [`kooldev/phpqa`](https://hub.docker.com/r/kooldev/phpqa/tags?page=1&ordering=last_updated) with tags: +- [**`8.3`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.3/Dockerfile) - [**`8.1`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.1/Dockerfile) - [**`8.0`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.0/Dockerfile) - [**`7.4`**](https://github.com/kool-dev/docker-phpqa/blob/main/7.4/Dockerfile) diff --git a/kool.yml b/kool.yml index 5787917..158d126 100644 --- a/kool.yml +++ b/kool.yml @@ -9,3 +9,5 @@ scripts: - docker build --pull -t kooldev/phpqa:8.0 8.0 # PHP 8.1 - docker build --pull -t kooldev/phpqa:8.1 8.1 + # PHP 8.3 + - docker build --pull -t kooldev/phpqa:8.3 8.3 From 9c7aefe1f281dc2cce0dd43ce938b5c0d45e7f56 Mon Sep 17 00:00:00 2001 From: Steven Pennington Date: Wed, 28 Feb 2024 11:23:26 -0700 Subject: [PATCH 3/4] add 8.3 to cicd --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 9010720..93dd00b 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['7.4', '8.0', '8.1'] + version: ['7.4', '8.0', '8.1', '8.3'] steps: - name: Checkout code From 7a3b02c9faef3fb9485a9311208ec2b491125889 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Wed, 28 Feb 2024 22:05:01 -0300 Subject: [PATCH 4/4] Tweaks + Add 8.2 --- .github/workflows/ci-cd.yml | 2 +- 8.2/Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 8.2/entrypoint.sh | 5 +++++ README.md | 1 + fwd-template.json | 30 ++++++++++++++++++++++++++++++ kool.yml | 2 ++ 6 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 8.2/Dockerfile create mode 100644 8.2/entrypoint.sh diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 93dd00b..9033ff8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['7.4', '8.0', '8.1', '8.3'] + version: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout code diff --git a/8.2/Dockerfile b/8.2/Dockerfile new file mode 100644 index 0000000..55baf2d --- /dev/null +++ b/8.2/Dockerfile @@ -0,0 +1,35 @@ +FROM kooldev/php:8.2 + +# make Composer global vendor/bin available through PATH +RUN echo "export PATH=\$PATH:\/root\/.composer\/vendor\/bin:\/phars/" | tee -a /etc/profile + +# install dependencies (ast) +RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ + && pecl install ast \ + && echo 'extension=ast.so' >> /usr/local/etc/php/php.ini \ + && docker-php-ext-enable xdebug \ + && apk del .build-deps \ + && rm -rf /var/cache/apk/* /tmp/* + +# install QA tools +RUN \ + # install and set up QA tools from Composer + composer global require squizlabs/php_codesniffer \ + phpstan/phpstan \ + friendsofphp/php-cs-fixer \ + phan/phan \ + # download PHAR and make them executable + && mkdir /phars \ + && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ + && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ + && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ + && chmod +x /phars/* \ + # post-install tools settings + && /phars/local-php-security-checker --update-cache + +ADD entrypoint.sh /kool/entrypoint.sh +RUN chmod +x /kool/entrypoint.sh + +ENTRYPOINT [ "/kool/entrypoint.sh" ] +CMD [ "composer", "--version" ] diff --git a/8.2/entrypoint.sh b/8.2/entrypoint.sh new file mode 100644 index 0000000..fd66291 --- /dev/null +++ b/8.2/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source /etc/profile + +exec "$@" diff --git a/README.md b/README.md index 17cefc4..499fea4 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ docker run --rm --init -it -v $(pwd):/app -w /app kooldev/phpqa:7.4 The image built is [`kooldev/phpqa`](https://hub.docker.com/r/kooldev/phpqa/tags?page=1&ordering=last_updated) with tags: - [**`8.3`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.3/Dockerfile) +- [**`8.2`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.2/Dockerfile) - [**`8.1`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.1/Dockerfile) - [**`8.0`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.0/Dockerfile) - [**`7.4`**](https://github.com/kool-dev/docker-phpqa/blob/main/7.4/Dockerfile) diff --git a/fwd-template.json b/fwd-template.json index 8b78aa6..78933b2 100644 --- a/fwd-template.json +++ b/fwd-template.json @@ -45,6 +45,36 @@ "path": "template/entrypoint" } ] + }, + { + "name": "8.2", + "data": { + "from": "kooldev/php:8.2" + }, + "files": [ + { + "name": "Dockerfile", + "path": "template/Dockerfile" + }, { + "name": "entrypoint.sh", + "path": "template/entrypoint" + } + ] + }, + { + "name": "8.3", + "data": { + "from": "kooldev/php:8.3" + }, + "files": [ + { + "name": "Dockerfile", + "path": "template/Dockerfile" + }, { + "name": "entrypoint.sh", + "path": "template/entrypoint" + } + ] } ] } diff --git a/kool.yml b/kool.yml index 158d126..d122195 100644 --- a/kool.yml +++ b/kool.yml @@ -9,5 +9,7 @@ scripts: - docker build --pull -t kooldev/phpqa:8.0 8.0 # PHP 8.1 - docker build --pull -t kooldev/phpqa:8.1 8.1 + # PHP 8.2 + - docker build --pull -t kooldev/phpqa:8.2 8.2 # PHP 8.3 - docker build --pull -t kooldev/phpqa:8.3 8.3