diff --git a/.github/workflows/pipes.yaml b/.github/workflows/pipes.yaml new file mode 100644 index 0000000..79a9a97 --- /dev/null +++ b/.github/workflows/pipes.yaml @@ -0,0 +1,46 @@ +name: Pipes + +on: + pull_request: + branches: + - master + paths: + - 'bin/**' + - 'build/**' + - 'scripts/**' + - 'src/**' + types: + - labeled + - unlabeled + - opened + - synchronize + push: + branches: + - master + paths: + - 'bin/**' + - 'build/**' + - 'scripts/**' + - 'src/**' + workflow_dispatch: + +jobs: + # build images and ensure no git diff + # run phpinfo and ensure correct version of xdebug is installed + build_and_verify: + name: Build and Verify + if: | + github.event_name == 'push' + || github.event_name == 'workflow_dispatch' + || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci')) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Verify builds are correct + run: | + make clean + make generate + ./scripts/git-has-changes.sh + - name: Build and verify CLI docker images + run: | + ./scripts/build-and-verify-cli-images.sh mobtitude/php-xdebug diff --git a/.gitignore b/.gitignore index a09c56d..6977e17 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ -/.idea +.* + +!.gitignore + +!.github/ diff --git a/README.md b/README.md index f38204e..defbc68 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,15 @@ Supported tags: * mobtitude/php-xdebug:7.2-apache * mobtitude/php-xdebug:7.2-cli * mobtitude/php-xdebug:7.2-fpm - +* mobtitude/php-xdebug:8.1-apache +* mobtitude/php-xdebug:8.1-cli +* mobtitude/php-xdebug:8.1-fpm +* mobtitude/php-xdebug:8.2-apache +* mobtitude/php-xdebug:8.2-cli +* mobtitude/php-xdebug:8.2-fpm +* mobtitude/php-xdebug:8.3-apache +* mobtitude/php-xdebug:8.3-cli +* mobtitude/php-xdebug:8.3-fpm Build from source ------------------- @@ -84,4 +92,4 @@ FAQ Q: Why images don't have specific PHP version like `7.2.2` but only major and minor version `7.2`? A: It is because images in this repo have always the newest possible patch version of PHP based on official Docker PHP images. -For example for `mobtitude/php-xdebug:7.2-apache` you can expect that it is always the newest PHP version available in official Docker Registry and it is automatically updated when official PHP Docker images are updated. The newest possible PHP version at the time of writing is 7.2.2, but will be automatically updated to 7.2.3 when official PHP Docker images are updated. \ No newline at end of file +For example for `mobtitude/php-xdebug:7.2-apache` you can expect that it is always the newest PHP version available in official Docker Registry and it is automatically updated when official PHP Docker images are updated. The newest possible PHP version at the time of writing is 7.2.2, but will be automatically updated to 7.2.3 when official PHP Docker images are updated. diff --git a/bin/build-all.sh b/bin/build-all.sh index c2479a2..4f482c5 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -60,4 +60,5 @@ if [ "${#build_failed[@]}" -gt 0 ]; then for img in "${build_failed[@]}"; do echo "${text_red}* ${img}${text_normal}" done + exit 1 fi diff --git a/bin/generate.sh b/bin/generate.sh index 1401b6d..ade5e99 100755 --- a/bin/generate.sh +++ b/bin/generate.sh @@ -5,8 +5,7 @@ # # PHP Versions that will be generated -#php_versions=( "8.0" "7.4" "7.2" "7.1" "7.0" "5.6") -php_versions=( "8.1" "8.0" "7.4" "7.2" ) +php_versions=( "8.3" "8.2" "8.1" "8.0" "7.4" ) # PHP variants that will be generated for each PHP version # final source image will be generated as follow: php:7.2-cli, php:7-2-apache and php:7.2-fpm @@ -16,13 +15,11 @@ php_docker_suffix=( "cli" "apache" "fpm" ) # PHP_VERSION => XDEBUG_VERSION declare -A xdebug_versions xdebug_versions=( + ["8.3"]="xdebug-3.3.1" + ["8.2"]="xdebug-3.3.1" ["8.1"]="xdebug-3.1.3" ["8.0"]="xdebug-3.1.3" ["7.4"]="xdebug-2.9.1" - ["7.2"]="xdebug-2.6.0" - ["7.1"]="xdebug-2.6.0" - ["7.0"]="xdebug-2.6.0" - ["5.6"]="xdebug-2.5.5" ) @@ -38,9 +35,10 @@ for php_version in "${php_versions[@]}"; do base_image="php:${php_version}-${php_suffix}" xdebug_version="${xdebug_versions[${php_version}]}" + xdebug_major_version=`echo "${xdebug_version}" | sed 's/xdebug-\([1-9][0-9]\{0,\}\)\..*/\1/'` mkdir -p "${target_dir}" - cp ./src/xdebug.ini "${target_dir}/xdebug.ini" + cp "./src/xdebug-${xdebug_major_version}.ini" "${target_dir}/xdebug.ini" # shellcheck disable=SC2002 cat ./src/Dockerfile \ diff --git a/build/7.2-apache/xdebug.ini b/build/7.2-apache/xdebug.ini deleted file mode 100644 index d94419d..0000000 --- a/build/7.2-apache/xdebug.ini +++ /dev/null @@ -1,13 +0,0 @@ -[xdebug] -zend_extension=xdebug.so - -xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 - -xdebug.profiler_output_dir="/tmp" -xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" - -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file diff --git a/build/7.2-cli/xdebug.ini b/build/7.2-cli/xdebug.ini deleted file mode 100644 index d94419d..0000000 --- a/build/7.2-cli/xdebug.ini +++ /dev/null @@ -1,13 +0,0 @@ -[xdebug] -zend_extension=xdebug.so - -xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 - -xdebug.profiler_output_dir="/tmp" -xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" - -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file diff --git a/build/7.4-apache/Dockerfile b/build/7.4-apache/Dockerfile index 2e998ff..beb7aa2 100644 --- a/build/7.4-apache/Dockerfile +++ b/build/7.4-apache/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-2.9.1 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/7.4-apache/xdebug.ini b/build/7.4-apache/xdebug.ini index d94419d..94ea677 100644 --- a/build/7.4-apache/xdebug.ini +++ b/build/7.4-apache/xdebug.ini @@ -10,4 +10,4 @@ xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" xdebug.remote_enable=1 xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.remote_port=9000 diff --git a/build/7.4-cli/Dockerfile b/build/7.4-cli/Dockerfile index 15d4d09..6f48039 100644 --- a/build/7.4-cli/Dockerfile +++ b/build/7.4-cli/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-2.9.1 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/7.4-cli/xdebug.ini b/build/7.4-cli/xdebug.ini index d94419d..94ea677 100644 --- a/build/7.4-cli/xdebug.ini +++ b/build/7.4-cli/xdebug.ini @@ -10,4 +10,4 @@ xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" xdebug.remote_enable=1 xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.remote_port=9000 diff --git a/build/7.4-fpm/Dockerfile b/build/7.4-fpm/Dockerfile index b8dacb2..5812a5e 100644 --- a/build/7.4-fpm/Dockerfile +++ b/build/7.4-fpm/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-2.9.1 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/7.4-fpm/xdebug.ini b/build/7.4-fpm/xdebug.ini index d94419d..94ea677 100644 --- a/build/7.4-fpm/xdebug.ini +++ b/build/7.4-fpm/xdebug.ini @@ -10,4 +10,4 @@ xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" xdebug.remote_enable=1 xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.remote_port=9000 diff --git a/build/8.0-apache/Dockerfile b/build/8.0-apache/Dockerfile index 9ccb6a1..227e69d 100644 --- a/build/8.0-apache/Dockerfile +++ b/build/8.0-apache/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-3.1.3 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.0-apache/xdebug.ini b/build/8.0-apache/xdebug.ini index d94419d..a6c56ff 100644 --- a/build/8.0-apache/xdebug.ini +++ b/build/8.0-apache/xdebug.ini @@ -2,12 +2,12 @@ zend_extension=xdebug.so xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug -xdebug.profiler_output_dir="/tmp" +xdebug.output_dir="/tmp" xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.0-cli/Dockerfile b/build/8.0-cli/Dockerfile index 26c81fc..7c2afdc 100644 --- a/build/8.0-cli/Dockerfile +++ b/build/8.0-cli/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-3.1.3 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.0-cli/xdebug.ini b/build/8.0-cli/xdebug.ini index d94419d..a6c56ff 100644 --- a/build/8.0-cli/xdebug.ini +++ b/build/8.0-cli/xdebug.ini @@ -2,12 +2,12 @@ zend_extension=xdebug.so xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug -xdebug.profiler_output_dir="/tmp" +xdebug.output_dir="/tmp" xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.0-fpm/Dockerfile b/build/8.0-fpm/Dockerfile index 2a40c8b..f80362d 100644 --- a/build/8.0-fpm/Dockerfile +++ b/build/8.0-fpm/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-3.1.3 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.0-fpm/xdebug.ini b/build/8.0-fpm/xdebug.ini index d94419d..a6c56ff 100644 --- a/build/8.0-fpm/xdebug.ini +++ b/build/8.0-fpm/xdebug.ini @@ -2,12 +2,12 @@ zend_extension=xdebug.so xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug -xdebug.profiler_output_dir="/tmp" +xdebug.output_dir="/tmp" xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.1-apache/Dockerfile b/build/8.1-apache/Dockerfile index 5d5126b..46a257d 100644 --- a/build/8.1-apache/Dockerfile +++ b/build/8.1-apache/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-3.1.3 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.1-apache/xdebug.ini b/build/8.1-apache/xdebug.ini index d94419d..a6c56ff 100644 --- a/build/8.1-apache/xdebug.ini +++ b/build/8.1-apache/xdebug.ini @@ -2,12 +2,12 @@ zend_extension=xdebug.so xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug -xdebug.profiler_output_dir="/tmp" +xdebug.output_dir="/tmp" xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.1-cli/Dockerfile b/build/8.1-cli/Dockerfile index dd5a7ff..4952ef7 100644 --- a/build/8.1-cli/Dockerfile +++ b/build/8.1-cli/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-3.1.3 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.1-cli/xdebug.ini b/build/8.1-cli/xdebug.ini index d94419d..a6c56ff 100644 --- a/build/8.1-cli/xdebug.ini +++ b/build/8.1-cli/xdebug.ini @@ -2,12 +2,12 @@ zend_extension=xdebug.so xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug -xdebug.profiler_output_dir="/tmp" +xdebug.output_dir="/tmp" xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.1-fpm/Dockerfile b/build/8.1-fpm/Dockerfile index e50f60d..0e1ffc4 100644 --- a/build/8.1-fpm/Dockerfile +++ b/build/8.1-fpm/Dockerfile @@ -16,4 +16,4 @@ RUN pecl channel-update pecl.php.net \ && pecl install xdebug-3.1.3 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.1-fpm/xdebug.ini b/build/8.1-fpm/xdebug.ini index d94419d..a6c56ff 100644 --- a/build/8.1-fpm/xdebug.ini +++ b/build/8.1-fpm/xdebug.ini @@ -2,12 +2,12 @@ zend_extension=xdebug.so xdebug.cli_color=1 -xdebug.profiler_enable=0 -xdebug.profiler_enable_trigger=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug -xdebug.profiler_output_dir="/tmp" +xdebug.output_dir="/tmp" xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.remote_port=9000 \ No newline at end of file +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.2-apache/Dockerfile b/build/8.2-apache/Dockerfile new file mode 100644 index 0000000..2ce61c7 --- /dev/null +++ b/build/8.2-apache/Dockerfile @@ -0,0 +1,19 @@ +FROM php:8.2-apache +MAINTAINER Przemek Szalko + +# php intl extension +RUN apt-get update \ + && apt-get install -y libicu-dev \ + && docker-php-ext-install intl \ + && docker-php-ext-install pdo_mysql \ + && docker-php-source delete \ + && apt-get remove -y libicu-dev \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN pecl channel-update pecl.php.net \ + && pecl install xdebug-3.3.1 \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.2-apache/xdebug.ini b/build/8.2-apache/xdebug.ini new file mode 100644 index 0000000..a6c56ff --- /dev/null +++ b/build/8.2-apache/xdebug.ini @@ -0,0 +1,13 @@ +[xdebug] +zend_extension=xdebug.so + +xdebug.cli_color=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug + +xdebug.output_dir="/tmp" +xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" + +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/7.2-fpm/Dockerfile b/build/8.2-cli/Dockerfile similarity index 83% rename from build/7.2-fpm/Dockerfile rename to build/8.2-cli/Dockerfile index 3e88148..1d3a7e4 100644 --- a/build/7.2-fpm/Dockerfile +++ b/build/8.2-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.2-fpm +FROM php:8.2-cli MAINTAINER Przemek Szalko # php intl extension @@ -13,7 +13,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* RUN pecl channel-update pecl.php.net \ - && pecl install xdebug-2.6.0 \ + && pecl install xdebug-3.3.1 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.2-cli/xdebug.ini b/build/8.2-cli/xdebug.ini new file mode 100644 index 0000000..a6c56ff --- /dev/null +++ b/build/8.2-cli/xdebug.ini @@ -0,0 +1,13 @@ +[xdebug] +zend_extension=xdebug.so + +xdebug.cli_color=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug + +xdebug.output_dir="/tmp" +xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" + +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/7.2-cli/Dockerfile b/build/8.2-fpm/Dockerfile similarity index 83% rename from build/7.2-cli/Dockerfile rename to build/8.2-fpm/Dockerfile index 47bc3ad..ebd39b5 100644 --- a/build/7.2-cli/Dockerfile +++ b/build/8.2-fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.2-cli +FROM php:8.2-fpm MAINTAINER Przemek Szalko # php intl extension @@ -13,7 +13,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* RUN pecl channel-update pecl.php.net \ - && pecl install xdebug-2.6.0 \ + && pecl install xdebug-3.3.1 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.2-fpm/xdebug.ini b/build/8.2-fpm/xdebug.ini new file mode 100644 index 0000000..a6c56ff --- /dev/null +++ b/build/8.2-fpm/xdebug.ini @@ -0,0 +1,13 @@ +[xdebug] +zend_extension=xdebug.so + +xdebug.cli_color=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug + +xdebug.output_dir="/tmp" +xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" + +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.3-apache/Dockerfile b/build/8.3-apache/Dockerfile new file mode 100644 index 0000000..43b5f9c --- /dev/null +++ b/build/8.3-apache/Dockerfile @@ -0,0 +1,19 @@ +FROM php:8.3-apache +MAINTAINER Przemek Szalko + +# php intl extension +RUN apt-get update \ + && apt-get install -y libicu-dev \ + && docker-php-ext-install intl \ + && docker-php-ext-install pdo_mysql \ + && docker-php-source delete \ + && apt-get remove -y libicu-dev \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN pecl channel-update pecl.php.net \ + && pecl install xdebug-3.3.1 \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.3-apache/xdebug.ini b/build/8.3-apache/xdebug.ini new file mode 100644 index 0000000..a6c56ff --- /dev/null +++ b/build/8.3-apache/xdebug.ini @@ -0,0 +1,13 @@ +[xdebug] +zend_extension=xdebug.so + +xdebug.cli_color=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug + +xdebug.output_dir="/tmp" +xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" + +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/7.2-apache/Dockerfile b/build/8.3-cli/Dockerfile similarity index 83% rename from build/7.2-apache/Dockerfile rename to build/8.3-cli/Dockerfile index 290c454..d1ab114 100644 --- a/build/7.2-apache/Dockerfile +++ b/build/8.3-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.2-apache +FROM php:8.3-cli MAINTAINER Przemek Szalko # php intl extension @@ -13,7 +13,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* RUN pecl channel-update pecl.php.net \ - && pecl install xdebug-2.6.0 \ + && pecl install xdebug-3.3.1 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.3-cli/xdebug.ini b/build/8.3-cli/xdebug.ini new file mode 100644 index 0000000..a6c56ff --- /dev/null +++ b/build/8.3-cli/xdebug.ini @@ -0,0 +1,13 @@ +[xdebug] +zend_extension=xdebug.so + +xdebug.cli_color=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug + +xdebug.output_dir="/tmp" +xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" + +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/build/8.3-fpm/Dockerfile b/build/8.3-fpm/Dockerfile new file mode 100644 index 0000000..92a6f45 --- /dev/null +++ b/build/8.3-fpm/Dockerfile @@ -0,0 +1,19 @@ +FROM php:8.3-fpm +MAINTAINER Przemek Szalko + +# php intl extension +RUN apt-get update \ + && apt-get install -y libicu-dev \ + && docker-php-ext-install intl \ + && docker-php-ext-install pdo_mysql \ + && docker-php-source delete \ + && apt-get remove -y libicu-dev \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN pecl channel-update pecl.php.net \ + && pecl install xdebug-3.3.1 \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini diff --git a/build/8.3-fpm/xdebug.ini b/build/8.3-fpm/xdebug.ini new file mode 100644 index 0000000..a6c56ff --- /dev/null +++ b/build/8.3-fpm/xdebug.ini @@ -0,0 +1,13 @@ +[xdebug] +zend_extension=xdebug.so + +xdebug.cli_color=1 +xdebug.mode=debug +xdebug.start_with_request=trigger +xdebug.trigger_value=StartXDebug + +xdebug.output_dir="/tmp" +xdebug.profiler_output_name="cachegrind.out.%H.%t.%p" + +xdebug.discover_client_host=true +xdebug.client_port=9003 diff --git a/scripts/build-and-verify-cli-images.sh b/scripts/build-and-verify-cli-images.sh new file mode 100755 index 0000000..5e4561d --- /dev/null +++ b/scripts/build-and-verify-cli-images.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +# +# Script builds all Dockerfiles defined in build directory +# Prints summary after all images have been built (successfully or not) +# + +image_name="$1" + +# Checks if image name was provided by user +if [ -z "${image_name}" ]; then + echo "Usage: $0 [docker_image_name]" >&2 + exit -1 +fi + +# Change current path to project root +script_path=$(dirname "$0") +cd "${script_path}/../" || exit -1 + +# Text formatting +text_bold=$(tput bold) +text_red=$(tput setaf 1) +text_normal=$(tput sgr0) + +# Loop through all available directories in ./build +for i in ./build/*/; do + version=$(basename "$i"); + image="${image_name}:${version}" + + if [ "$version" == "${version%"cli"*}" ]; then + continue + fi + + echo "${text_bold}* Building ${image} ${text_normal}" + + # Builds image and check for return code + if ! docker build --pull -t "${image}" "./build/${version}"; then + echo "${text_bold}${text_red}* ERROR when building ${image} ${text_normal}" + exit 1 + fi + + echo "${text_bold}* Testing ${image} ${text_normal}" + + docker run \ + --volume ./scripts/test-xdebug-install.php:/app/test-xdebug-install.php \ + --workdir /app \ + --entrypoint php \ + "${image}" test-xdebug-install.php +done + diff --git a/scripts/git-has-changes.sh b/scripts/git-has-changes.sh new file mode 100755 index 0000000..59278d4 --- /dev/null +++ b/scripts/git-has-changes.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if [[ -n $(git status --porcelain --untracked-files=no) ]]; then + exit 1 +fi diff --git a/scripts/test-xdebug-install.php b/scripts/test-xdebug-install.php new file mode 100755 index 0000000..21a8f78 --- /dev/null +++ b/scripts/test-xdebug-install.php @@ -0,0 +1,20 @@ +