Skip to content

Commit e45e830

Browse files
author
Umut Işık
authored
Merge pull request #26 from umutphp/25-php-83-support
Add PHP 8.3 support
2 parents 3ffcd11 + 5bd8d46 commit e45e830

File tree

4 files changed

+320
-1
lines changed

4 files changed

+320
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The tools that are installed by Composer are isolated by using different folder
5656
- umutphp/php-docker-images-for-ci:8.0 (PHP 8.0.28)
5757
- umutphp/php-docker-images-for-ci:8.1 (PHP 8.1.18)
5858
- umutphp/php-docker-images-for-ci:8.2 (PHP 8.2.5)
59+
- umutphp/php-docker-images-for-ci:8.3 (PHP 8.3-rc)
5960

6061
## List of Alpine Based PHP Images ##
6162
- umutphp/php-docker-images-for-ci:7.0-alpine (PHP 7.0.33)
@@ -66,6 +67,7 @@ The tools that are installed by Composer are isolated by using different folder
6667
- umutphp/php-docker-images-for-ci:8.0-alpine (PHP 8.0.28-apline)
6768
- umutphp/php-docker-images-for-ci:8.1-alpine (PHP 8.1.18-alpine)
6869
- umutphp/php-docker-images-for-ci:8.1-alpine (PHP 8.2.5-alpine)
70+
- umutphp/php-docker-images-for-ci:8.3-alpine (PHP 8.3-rc-alpine)
6971

7072
## List of CI Tools ##
7173

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
## declare an array variable
4-
declare -a array=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
4+
declare -a array=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2" "8.3")
55

66
# get length of an array
77
arraylength=${#array[@]}

images/8.3/Dockerfile

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
FROM php:8.3-rc
2+
3+
# disable interactive functions
4+
ENV DEBIAN_FRONTEND noninteractive
5+
6+
RUN apt-get update && \
7+
apt-get -y install --no-install-recommends libmcrypt-dev libreadline-dev zlib1g-dev libxml2-dev libzip-dev apt-utils curl git zip unzip libonig-dev && \
8+
rm -rf /var/lib/apt/lists/*
9+
10+
RUN docker-php-ext-install \
11+
mbstring \
12+
zip \
13+
pdo_mysql \
14+
mysqli \
15+
xml \
16+
bcmath
17+
18+
RUN apt-get update && \
19+
apt-get install -y zlib1g-dev libicu-dev g++ && \
20+
rm -rf /var/lib/apt/lists/* && \
21+
docker-php-ext-configure intl && \
22+
docker-php-ext-install intl
23+
24+
# Install PHP Code Sniffer
25+
RUN curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o phpcs && \
26+
curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -o phpcbf && \
27+
chmod a+x phpcs && \
28+
chmod a+x phpcbf && \
29+
mv phpcs /usr/local/bin/phpcs && \
30+
mv phpcbf /usr/local/bin/phpcbf
31+
32+
# Install PHP Copy Paste Detector
33+
RUN curl -L https://phar.phpunit.de/phpcpd.phar -o phpcpd.phar && \
34+
chmod +x phpcpd.phar && \
35+
mv phpcpd.phar /usr/local/bin/phpcpd
36+
37+
# Install PHP Dead Code Detector
38+
RUN curl -L https://phar.phpunit.de/phpdcd.phar -o phpdcd.phar && \
39+
chmod +x phpdcd.phar && \
40+
mv phpdcd.phar /usr/local/bin/phpdcd
41+
42+
# Install Composer
43+
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php && \
44+
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
45+
46+
# Install PhpMetrics
47+
RUN curl -OL https://github.com/phpmetrics/PhpMetrics/releases/download/v2.3.2/phpmetrics.phar && \
48+
chmod +x phpmetrics.phar && mv phpmetrics.phar /usr/local/bin/phpmetrics
49+
50+
# Install phpcs-security-audit v2 sniffes
51+
RUN mkdir -p /opt/phpcs/snifss/ && \
52+
cd /opt/phpcs/snifss/ && \
53+
git clone -b master https://github.com/FloeDesignTechnologies/phpcs-security-audit.git phpcs-security-audit && \
54+
phpcs --config-set installed_paths /opt/phpcs/snifss/phpcs-security-audit/
55+
56+
# Create tools folder
57+
RUN mkdir -p /tools
58+
59+
# Set global bin-dir for composer packages
60+
ENV COMPOSER_BIN_DIR="/usr/local/bin"
61+
62+
# Install Psecio Parse
63+
RUN mkdir -p /tools/psecio/parse && \
64+
cd /tools/psecio/parse && \
65+
composer require --dev psecio/parse && \
66+
cd -
67+
68+
# Install PHP-Var-Dump-Check
69+
RUN mkdir -p /tools/php-parallel-lint/php-var-dump-check && \
70+
cd /tools/php-parallel-lint/php-var-dump-check && \
71+
composer require --dev php-parallel-lint/php-var-dump-check && \
72+
cd -
73+
74+
# Install PHP-Parallel-Lint
75+
RUN mkdir -p /tools/php-parallel-lint/php-parallel-lint && \
76+
cd /tools/php-parallel-lint/php-parallel-lint && \
77+
composer require --dev php-parallel-lint/php-parallel-lint && \
78+
cd -
79+
80+
# Install PHP Assumptions
81+
RUN mkdir -p /tools/rskuipers/php-assumptions && \
82+
cd /tools/rskuipers/php-assumptions && \
83+
composer require --dev rskuipers/php-assumptions && \
84+
cd -
85+
86+
# Install churn-php
87+
RUN mkdir -p /tools/bmitch/churn-php && \
88+
cd /tools/bmitch/churn-php && \
89+
composer require --dev bmitch/churn-php && \
90+
cd -
91+
92+
# Install Fink
93+
RUN mkdir -p /tools/dantleech/fink && \
94+
cd /tools/dantleech/fink && \
95+
composer require --dev dantleech/fink && \
96+
cd -
97+
98+
# Install Pint
99+
RUN mkdir -p /tools/laravel/pint && \
100+
cd /tools/laravel/pint && \
101+
composer require laravel/pint --dev && \
102+
cd -
103+
104+
# Add update script
105+
ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/update.sh /update.sh
106+
RUN chmod +x /update.sh
107+
108+
# Add gitignore check script
109+
ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/gitignore_checker.sh /gitignore_checker.sh
110+
RUN chmod +x /gitignore_checker.sh && ln -s /gitignore_checker.sh /usr/local/bin/gitignore_checker
111+
112+
# Add merge conflict checker script
113+
ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/merge_conflict_checker.sh /merge_conflict_checker.sh
114+
RUN chmod +x /merge_conflict_checker.sh && ln -s /merge_conflict_checker.sh /usr/local/bin/merge_conflict_checker
115+
116+
# Install PHPMD
117+
RUN mkdir -p /tools/phpmd/phpmd && \
118+
cd /tools/phpmd/phpmd && \
119+
composer require --dev phpmd/phpmd && \
120+
cd -
121+
122+
# Install PHP_Testability
123+
RUN mkdir -p /tools/edsonmedina/php_testability && \
124+
cd /tools/edsonmedina/php_testability && \
125+
composer require --dev edsonmedina/php_testability:dev-master && \
126+
cd -
127+
128+
# Install composer-normalize
129+
RUN composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true && composer global require ergebnis/composer-normalize
130+
131+
# Install infection/infection for mutation testing
132+
RUN pecl install xdebug-3.3.0alpha3 && docker-php-ext-enable xdebug
133+
RUN composer global config --no-plugins allow-plugins.infection/extension-installer true && composer global require infection/infection
134+
135+
# Install Deptrac
136+
RUN mkdir -p /tools/deptrac && \
137+
curl -LS https://github.com/sensiolabs-de/deptrac/releases/download/0.6.0/deptrac.phar -o deptrac.phar && \
138+
chmod +x deptrac.phar && mv deptrac.phar /tools/deptrac/deptrac
139+
140+
# Install phpstan
141+
RUN mkdir -p /tools/phpstan/phpstan && \
142+
cd /tools/phpstan/phpstan && \
143+
composer require --dev phpstan/phpstan && \
144+
cd -
145+
146+
# Install local-php-security-checker
147+
RUN mkdir -p /tools/local-php-security-checker && \
148+
cd /tools/local-php-security-checker && \
149+
curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o local-php-security-checker && \
150+
chmod +x local-php-security-checker && \
151+
mv local-php-security-checker /usr/local/bin/local-php-security-checker
152+
153+
# Unset COMPOSER_BIN_DIR
154+
ENV COMPOSER_BIN_DIR="vendor/bin"
155+
156+
# Unset the entry point
157+
ENTRYPOINT []

images/8.3/Dockerfile-alpine

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
FROM php:8.3-rc-alpine
2+
3+
# disable interactive functions
4+
ENV DEBIAN_FRONTEND noninteractive
5+
6+
RUN apk --no-cache add libzip-dev && \
7+
apk --no-cache --update add --virtual .build-deps gcc make g++ zlib-dev libmcrypt-dev libxml2-dev libzip-dev curl git zip unzip oniguruma-dev autoconf && \
8+
rm -rf /var/cache/apk/*
9+
10+
RUN docker-php-ext-install \
11+
mbstring \
12+
zip \
13+
pdo_mysql \
14+
mysqli \
15+
xml \
16+
bcmath
17+
18+
RUN apk add icu-dev && \
19+
docker-php-ext-configure intl && \
20+
docker-php-ext-install intl && \
21+
rm -rf /var/cache/apk/*
22+
23+
# Install PHP Code Sniffer
24+
RUN curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o phpcs && \
25+
curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -o phpcbf && \
26+
chmod a+x phpcs && \
27+
chmod a+x phpcbf && \
28+
mv phpcs /usr/local/bin/phpcs && \
29+
mv phpcbf /usr/local/bin/phpcbf
30+
31+
# Install PHP Copy Paste Detector
32+
RUN curl -L https://phar.phpunit.de/phpcpd.phar -o phpcpd.phar && \
33+
chmod +x phpcpd.phar && \
34+
mv phpcpd.phar /usr/local/bin/phpcpd
35+
36+
# Install PHP Dead Code Detector
37+
RUN curl -L https://phar.phpunit.de/phpdcd.phar -o phpdcd.phar && \
38+
chmod +x phpdcd.phar && \
39+
mv phpdcd.phar /usr/local/bin/phpdcd
40+
41+
# Install Composer
42+
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php && \
43+
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
44+
45+
# Install PhpMetrics
46+
RUN curl -OL https://github.com/phpmetrics/PhpMetrics/releases/download/v2.3.2/phpmetrics.phar && \
47+
chmod +x phpmetrics.phar && mv phpmetrics.phar /usr/local/bin/phpmetrics
48+
49+
# Install phpcs-security-audit v2 sniffes
50+
RUN mkdir -p /opt/phpcs/snifss/ && \
51+
cd /opt/phpcs/snifss/ && \
52+
git clone -b master https://github.com/FloeDesignTechnologies/phpcs-security-audit.git phpcs-security-audit && \
53+
phpcs --config-set installed_paths /opt/phpcs/snifss/phpcs-security-audit/
54+
55+
# Create tools folder
56+
RUN mkdir -p /tools
57+
58+
# Set global bin-dir for composer packages
59+
ENV COMPOSER_BIN_DIR="/usr/local/bin"
60+
61+
# Install Psecio Parse
62+
RUN mkdir -p /tools/psecio/parse && \
63+
cd /tools/psecio/parse && \
64+
composer require --dev psecio/parse && \
65+
cd -
66+
67+
# Install PHP-Var-Dump-Check
68+
RUN mkdir -p /tools/php-parallel-lint/php-var-dump-check && \
69+
cd /tools/php-parallel-lint/php-var-dump-check && \
70+
composer require --dev php-parallel-lint/php-var-dump-check && \
71+
cd -
72+
73+
# Install PHP-Parallel-Lint
74+
RUN mkdir -p /tools/php-parallel-lint/php-parallel-lint && \
75+
cd /tools/php-parallel-lint/php-parallel-lint && \
76+
composer require --dev php-parallel-lint/php-parallel-lint && \
77+
cd -
78+
79+
# Install PHP Assumptions
80+
RUN mkdir -p /tools/rskuipers/php-assumptions && \
81+
cd /tools/rskuipers/php-assumptions && \
82+
composer require --dev rskuipers/php-assumptions && \
83+
cd -
84+
85+
# Install churn-php
86+
RUN mkdir -p /tools/bmitch/churn-php && \
87+
cd /tools/bmitch/churn-php && \
88+
composer require --dev bmitch/churn-php && \
89+
cd -
90+
91+
# Install Fink
92+
RUN mkdir -p /tools/dantleech/fink && \
93+
cd /tools/dantleech/fink && \
94+
composer require --dev dantleech/fink && \
95+
cd -
96+
97+
# Install Pint
98+
RUN mkdir -p /tools/laravel/pint && \
99+
cd /tools/laravel/pint && \
100+
composer require laravel/pint --dev && \
101+
cd -
102+
103+
# Add update script
104+
ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/update.sh /update.sh
105+
RUN chmod +x /update.sh
106+
107+
# Add gitignore check script
108+
ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/gitignore_checker.sh /gitignore_checker.sh
109+
RUN chmod +x /gitignore_checker.sh && ln -s /gitignore_checker.sh /usr/local/bin/gitignore_checker
110+
111+
# Add merge conflict checker script
112+
ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/merge_conflict_checker.sh /merge_conflict_checker.sh
113+
RUN chmod +x /merge_conflict_checker.sh && ln -s /merge_conflict_checker.sh /usr/local/bin/merge_conflict_checker
114+
115+
# Install PHPMD
116+
RUN mkdir -p /tools/phpmd/phpmd && \
117+
cd /tools/phpmd/phpmd && \
118+
composer require --dev phpmd/phpmd && \
119+
cd -
120+
121+
# Install PHP_Testability
122+
RUN mkdir -p /tools/edsonmedina/php_testability && \
123+
cd /tools/edsonmedina/php_testability && \
124+
composer require --dev edsonmedina/php_testability:dev-master && \
125+
cd -
126+
127+
# Install composer-normalize
128+
RUN composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true && composer global require ergebnis/composer-normalize
129+
130+
# Install infection/infection for mutation testing
131+
RUN apk add --update linux-headers && rm -rf /var/cache/apk/*
132+
RUN pecl install xdebug && docker-php-ext-enable xdebug && docker-php-ext-configure zip && docker-php-ext-install zip
133+
RUN composer global config --no-plugins allow-plugins.infection/extension-installer true && composer global require infection/infection
134+
135+
# Install Deptrac
136+
RUN mkdir -p /tools/deptrac && \
137+
curl -LS https://github.com/sensiolabs-de/deptrac/releases/download/0.6.0/deptrac.phar -o deptrac.phar && \
138+
chmod +x deptrac.phar && mv deptrac.phar /tools/deptrac/deptrac
139+
140+
# Install phpstan
141+
RUN mkdir -p /tools/phpstan/phpstan && \
142+
cd /tools/phpstan/phpstan && \
143+
composer require --dev phpstan/phpstan && \
144+
cd -
145+
146+
# Remove build dependencies
147+
RUN apk del .build-deps
148+
149+
# Install local-php-security-checker
150+
RUN mkdir -p /tools/local-php-security-checker && \
151+
cd /tools/local-php-security-checker && \
152+
curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o local-php-security-checker && \
153+
chmod +x local-php-security-checker && \
154+
mv local-php-security-checker /usr/local/bin/local-php-security-checker
155+
156+
# Unset COMPOSER_BIN_DIR
157+
ENV COMPOSER_BIN_DIR="vendor/bin"
158+
159+
# Unset the entry point
160+
ENTRYPOINT []

0 commit comments

Comments
 (0)