|
1 | | -ARG PHP_VERSION |
| 1 | +ARG PHP_VERSION=8.2 |
2 | 2 | FROM php:${PHP_VERSION}-cli-bookworm |
3 | 3 |
|
4 | | -RUN apt-get update && \ |
5 | | - apt-get install -y autoconf pkg-config && \ |
6 | | - pecl channel-update pecl.php.net && \ |
7 | | - pecl install xdebug &&\ |
8 | | - docker-php-ext-enable opcache xdebug |
| 4 | +RUN <<-EOF |
| 5 | + docker-php-ext-enable opcache |
9 | 6 |
|
10 | | -RUN echo '\ |
11 | | -xdebug.client_host=host.docker.internal\n\ |
12 | | -xdebug.mode=develop\n\ |
13 | | -xdebug.start_with_request=yes\n\ |
14 | | -' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini |
| 7 | + if [ "$PHP_VERSION" \< "8.4" ]; then |
| 8 | + apt-get update |
| 9 | + apt-get install -y autoconf pkg-config |
| 10 | + pecl channel-update pecl.php.net |
| 11 | + pecl install xdebug |
| 12 | + docker-php-ext-enable xdebug |
| 13 | + fi |
| 14 | +EOF |
15 | 15 |
|
16 | | -RUN echo '\ |
17 | | -display_errors=On\n\ |
18 | | -error_reporting=E_ALL\n\ |
19 | | -date.timezone=UTC\n\ |
20 | | -' >> /usr/local/etc/php/conf.d/php.ini |
| 16 | +RUN <<-EOF |
| 17 | + cat <<-SHELL >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini |
| 18 | + xdebug.client_host=host.docker.internal |
| 19 | + xdebug.mode=develop |
| 20 | + xdebug.start_with_request=yes |
| 21 | + SHELL |
| 22 | + |
| 23 | + cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini |
| 24 | + display_errors=On |
| 25 | + error_reporting=E_ALL |
| 26 | + date.timezone=UTC |
| 27 | + SHELL |
| 28 | +EOF |
21 | 29 |
|
22 | 30 | ENV COMPOSER_ALLOW_SUPERUSER 1 |
23 | 31 |
|
24 | | -RUN apt-get update && \ |
25 | | - apt-get install unzip && \ |
26 | | - curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \ |
27 | | - mv composer.phar /usr/local/bin/composer && \ |
28 | | - echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n' >> /root/.bashrc |
| 32 | +RUN <<-EOF |
| 33 | + apt-get update |
| 34 | + apt-get install unzip |
| 35 | + curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet |
| 36 | + mv composer.phar /usr/local/bin/composer |
| 37 | + cat <<-SHELL >> /root/.bashrc |
| 38 | + export PATH="$HOME/.composer/vendor/bin:$PATH" |
| 39 | + SHELL |
| 40 | +EOF |
29 | 41 |
|
30 | 42 | RUN composer global require squizlabs/php_codesniffer |
31 | 43 |
|
|
0 commit comments