Skip to content

Commit ff4e4f3

Browse files
committed
PHP 8.1
1 parent 9eb7e4d commit ff4e4f3

File tree

11 files changed

+116
-18
lines changed

11 files changed

+116
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea

bin/generate.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Generates Dockerfiles for specified PHP versions
55
#
66

7-
# PHP Versions that will be generated
7+
# PHP Versions that will be generated
88
#php_versions=( "8.0" "7.4" "7.2" "7.1" "7.0" "5.6")
9-
php_versions=( "8.0" "7.4" "7.2" )
9+
php_versions=( "8.1" "8.0" "7.4" "7.2" )
1010

1111
# PHP variants that will be generated for each PHP version
1212
# final source image will be generated as follow: php:7.2-cli, php:7-2-apache and php:7.2-fpm
@@ -15,37 +15,38 @@ php_docker_suffix=( "cli" "apache" "fpm" )
1515
# Map of xdebug versions for PHP images
1616
# PHP_VERSION => XDEBUG_VERSION
1717
declare -A xdebug_versions
18-
xdebug_versions=(
19-
["8.0"]="xdebug-3.0.4"
20-
["7.4"]="xdebug-2.9.1"
21-
["7.2"]="xdebug-2.6.0"
22-
["7.1"]="xdebug-2.6.0"
23-
["7.0"]="xdebug-2.6.0"
24-
["5.6"]="xdebug-2.5.5"
18+
xdebug_versions=(
19+
["8.1"]="xdebug-3.1.3"
20+
["8.0"]="xdebug-3.1.3"
21+
["7.4"]="xdebug-2.9.1"
22+
["7.2"]="xdebug-2.6.0"
23+
["7.1"]="xdebug-2.6.0"
24+
["7.0"]="xdebug-2.6.0"
25+
["5.6"]="xdebug-2.5.5"
2526
)
2627

2728

2829
# Changes current path to project root
2930
script_path=$(dirname "$0")
30-
cd "${script_path}/../" || exit -1
31+
cd "${script_path}/../" || exit 1
3132

3233
# Generates Dockerfiles for each PHP version and variant
33-
for php_version in "${php_versions[@]}"; do
34+
for php_version in "${php_versions[@]}"; do
3435
for php_suffix in "${php_docker_suffix[@]}"; do
3536
target_dir="./build/${php_version}-${php_suffix}"
3637
target_dockerfile="${target_dir}/Dockerfile"
37-
38+
3839
base_image="php:${php_version}-${php_suffix}"
3940
xdebug_version="${xdebug_versions[${php_version}]}"
40-
41+
4142
mkdir -p "${target_dir}"
4243
cp ./src/xdebug.ini "${target_dir}/xdebug.ini"
43-
44+
4445
# shellcheck disable=SC2002
4546
cat ./src/Dockerfile \
4647
| sed "s/#BASE_IMAGE#/${base_image}/g" \
4748
| sed "s/#XDEBUG_VERSION#/${xdebug_version}/g" \
4849
> "${target_dockerfile}"
4950
echo "Generated ${target_dockerfile}"
5051
done
51-
done
52+
done

build/8.0-apache/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get update \
1313
&& rm -rf /var/lib/apt/lists/*
1414

1515
RUN pecl channel-update pecl.php.net \
16-
&& pecl install xdebug-3.0.4 \
16+
&& pecl install xdebug-3.1.3 \
1717
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
1818

1919
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

build/8.0-cli/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get update \
1313
&& rm -rf /var/lib/apt/lists/*
1414

1515
RUN pecl channel-update pecl.php.net \
16-
&& pecl install xdebug-3.0.4 \
16+
&& pecl install xdebug-3.1.3 \
1717
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
1818

1919
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

build/8.0-fpm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get update \
1313
&& rm -rf /var/lib/apt/lists/*
1414

1515
RUN pecl channel-update pecl.php.net \
16-
&& pecl install xdebug-3.0.4 \
16+
&& pecl install xdebug-3.1.3 \
1717
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
1818

1919
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

build/8.1-apache/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM php:8.1-apache
2+
MAINTAINER Przemek Szalko <[email protected]>
3+
4+
# php intl extension
5+
RUN apt-get update \
6+
&& apt-get install -y libicu-dev \
7+
&& docker-php-ext-install intl \
8+
&& docker-php-ext-install pdo_mysql \
9+
&& docker-php-source delete \
10+
&& apt-get remove -y libicu-dev \
11+
&& apt-get autoremove -y \
12+
&& apt-get clean \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
RUN pecl channel-update pecl.php.net \
16+
&& pecl install xdebug-3.1.3 \
17+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
18+
19+
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

build/8.1-apache/xdebug.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[xdebug]
2+
zend_extension=xdebug.so
3+
4+
xdebug.cli_color=1
5+
xdebug.profiler_enable=0
6+
xdebug.profiler_enable_trigger=1
7+
8+
xdebug.profiler_output_dir="/tmp"
9+
xdebug.profiler_output_name="cachegrind.out.%H.%t.%p"
10+
11+
xdebug.remote_enable=1
12+
xdebug.remote_connect_back=1
13+
xdebug.remote_port=9000

build/8.1-cli/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM php:8.1-cli
2+
MAINTAINER Przemek Szalko <[email protected]>
3+
4+
# php intl extension
5+
RUN apt-get update \
6+
&& apt-get install -y libicu-dev \
7+
&& docker-php-ext-install intl \
8+
&& docker-php-ext-install pdo_mysql \
9+
&& docker-php-source delete \
10+
&& apt-get remove -y libicu-dev \
11+
&& apt-get autoremove -y \
12+
&& apt-get clean \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
RUN pecl channel-update pecl.php.net \
16+
&& pecl install xdebug-3.1.3 \
17+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
18+
19+
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

build/8.1-cli/xdebug.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[xdebug]
2+
zend_extension=xdebug.so
3+
4+
xdebug.cli_color=1
5+
xdebug.profiler_enable=0
6+
xdebug.profiler_enable_trigger=1
7+
8+
xdebug.profiler_output_dir="/tmp"
9+
xdebug.profiler_output_name="cachegrind.out.%H.%t.%p"
10+
11+
xdebug.remote_enable=1
12+
xdebug.remote_connect_back=1
13+
xdebug.remote_port=9000

build/8.1-fpm/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM php:8.1-fpm
2+
MAINTAINER Przemek Szalko <[email protected]>
3+
4+
# php intl extension
5+
RUN apt-get update \
6+
&& apt-get install -y libicu-dev \
7+
&& docker-php-ext-install intl \
8+
&& docker-php-ext-install pdo_mysql \
9+
&& docker-php-source delete \
10+
&& apt-get remove -y libicu-dev \
11+
&& apt-get autoremove -y \
12+
&& apt-get clean \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
RUN pecl channel-update pecl.php.net \
16+
&& pecl install xdebug-3.1.3 \
17+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
18+
19+
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

0 commit comments

Comments
 (0)