-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathphpunit9.docker
More file actions
49 lines (46 loc) · 1.73 KB
/
phpunit9.docker
File metadata and controls
49 lines (46 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# chekote/phpunit9:latest
# chekote/phpunit9:${PHP_MAJOR_VERSION}
# chekote/phpunit9:${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
# chekote/phpunit9:${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}.${PHP_PATCH_VERSION}
# chekote/phpunit9:${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}.${PHP_PATCH_VERSION}-$(date '+%Y-%m-%d-%H-%M-%S')
ARG PHP_MAJOR_VERSION=8
ARG PHP_MINOR_VERSION=4
FROM chekote/composer:$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION
ENV MIN_PHP_VERSION='7.3'
RUN set -eu; \
#
check_php_version $MIN_PHP_VERSION; \
#
apt-get update; \
apt-get install -y --no-install-recommends \
#
# PHPUnit requirements.
# See https://github.com/sebastianbergmann/phpunit/blob/9.0.0/composer.json
# See https://phpunit.readthedocs.io/en/9.5/installation.html#requirements
php${PHP_VERSION}-dom \
#php${PHP_VERSION}-libxml \ (already included)
php${PHP_VERSION}-mbstring \
#php${PHP_VERSION}-pcre \ (already included)
#php${PHP_VERSION}-reflection \ (already included)
#php${PHP_VERSION}-spl \ (already included)
php${PHP_VERSION}-xml \
#
# Code coverage requirements
php${PHP_VERSION}-tokenizer \
php${PHP_VERSION}-xdebug \
php${PHP_VERSION}-xmlwriter; \
#
# php-json is not available for PHP 8, so only install it if we're working with lower than 8
if php -r "exit((int) version_compare('8.0', phpversion(), '<'));"; then \
apt-get install -y --no-install-recommends php${PHP_VERSION}-json; \
fi; \
#
# Cleanup
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /var/cache/apt/*; \
#
# Make sure everything works
php -v; \
php-fpm$PHP_VERSION -v