Skip to content

Adding PHP 8.1 #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.4', '8.0']
version: ['7.4', '8.0', '8.1']

steps:
- name: Checkout code
Expand Down
35 changes: 35 additions & 0 deletions 8.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM kooldev/php:8.1

# 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" ]
5 changes: 5 additions & 0 deletions 8.1/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

source /etc/profile

exec "$@"
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ 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:

- [**`7.4`**](https://github.com/kool-dev/docker-phpqa/blob/main/7.4/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)

## Using `kool.yml`

Expand All @@ -60,7 +61,7 @@ Examples of what you can do in a `kool` powered environment. Add to your `kool.y
# kool.yml
scripts:
# just an alias to the PHPQA container
phpqa: kool docker kooldev/phpqa:8.0
phpqa: kool docker kooldev/phpqa:8.1
# using the alias to call each tool with predefined parameters
# assuming your application code is located in a `app/` folder
phan: kool run phpqa phan --color -p -l app -iy 5
Expand Down
15 changes: 15 additions & 0 deletions fwd-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@
"path": "template/entrypoint"
}
]
},
{
"name": "8.1",
"data": {
"from": "kooldev/php:8.1"
},
"files": [
{
"name": "Dockerfile",
"path": "template/Dockerfile"
}, {
"name": "entrypoint.sh",
"path": "template/entrypoint"
}
]
}
]
}
2 changes: 2 additions & 0 deletions kool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ scripts:
- docker build --pull -t kooldev/phpqa:7.4 7.4
# PHP 8.0
- docker build --pull -t kooldev/phpqa:8.0 8.0
# PHP 8.1
- docker build --pull -t kooldev/phpqa:8.1 8.1