From 92cd374585c5f7d855d989303e639f0bc2330f78 Mon Sep 17 00:00:00 2001 From: Julien Falque Date: Sun, 19 Dec 2021 12:53:29 +0100 Subject: [PATCH] Update Docker setup --- docker-compose.override.yaml.dist | 6 +++--- docker-compose.yaml | 10 +++++----- docker/php-7.1/xdebug.ini | 5 ----- docker/php-7.2/Dockerfile | 15 +++++++-------- docker/php-7.2/xdebug.ini | 7 +++---- docker/php-7.3/Dockerfile | 17 ++++++++--------- docker/php-7.4/Dockerfile | 17 ++++++++--------- docker/php-8.0/Dockerfile | 17 ++++++++--------- docker/{php-7.1 => php-8.1}/Dockerfile | 19 +++++++++---------- docker/php-8.1/xdebug.ini | 4 ++++ 10 files changed, 55 insertions(+), 62 deletions(-) delete mode 100644 docker/php-7.1/xdebug.ini rename docker/{php-7.1 => php-8.1}/Dockerfile (61%) create mode 100644 docker/php-8.1/xdebug.ini diff --git a/docker-compose.override.yaml.dist b/docker-compose.override.yaml.dist index 334577cbc68..79938cc8915 100644 --- a/docker-compose.override.yaml.dist +++ b/docker-compose.override.yaml.dist @@ -1,7 +1,7 @@ version: '3.8' services: - php-7.1: &php + php-7.2: &php build: args: DOCKER_USER_ID: 1000 # replace with your user id (most likely 1000) @@ -11,11 +11,11 @@ services: # Required for Docker Linux until natively supported. # See https://github.com/docker/for-linux/issues/264 host.docker.internal: 172.17.0.1 - php-7.2: - <<: *php php-7.3: <<: *php php-7.4: <<: *php php-8.0: <<: *php + php-8.1: + <<: *php diff --git a/docker-compose.yaml b/docker-compose.yaml index 1e3b481bcf7..71eb92637e8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,17 +1,14 @@ version: '3.8' services: - php-7.1: &php - build: docker/php-7.1 + php-7.2: &php + build: docker/php-7.2 working_dir: /app volumes: - .:/app environment: PHP_IDE_CONFIG: serverName=php-cs-fixer PHP_CS_FIXER_ALLOW_XDEBUG: 1 - php-7.2: - <<: *php - build: docker/php-7.2 php-7.3: <<: *php build: docker/php-7.3 @@ -21,3 +18,6 @@ services: php-8.0: <<: *php build: docker/php-8.0 + php-8.1: + <<: *php + build: docker/php-8.1 diff --git a/docker/php-7.1/xdebug.ini b/docker/php-7.1/xdebug.ini deleted file mode 100644 index 8ea67c8bebd..00000000000 --- a/docker/php-7.1/xdebug.ini +++ /dev/null @@ -1,5 +0,0 @@ -;zend_extension=xdebug.so -xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_host=host.docker.internal -xdebug.remote_port=9003 diff --git a/docker/php-7.2/Dockerfile b/docker/php-7.2/Dockerfile index 8d3672c3cae..5c918abb906 100644 --- a/docker/php-7.2/Dockerfile +++ b/docker/php-7.2/Dockerfile @@ -9,19 +9,18 @@ RUN if ! getent group "${DOCKER_GROUP_ID}" > /dev/null; \ && if ! getent passwd "${DOCKER_USER_ID}" > /dev/null; \ then adduser -S -u "${DOCKER_USER_ID}" -G "$(getent group "${DOCKER_GROUP_ID}" | awk -F: '{printf $1}')" dev; \ fi \ - && apk add --no-cache git libxml2-dev openssh-client \ - && apk add --no-cache --virtual .build-deps autoconf g++ make \ - # xdebug - && pecl install xdebug-2.9.8 \ - && docker-php-ext-enable xdebug \ + # php extensions + && curl --location --output /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions \ + && sync \ + && install-php-extensions \ + xdebug-3.1.2 \ # composer && curl --output composer-setup.php https://getcomposer.org/installer \ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php \ # xdebug command && curl --location --output /usr/local/bin/xdebug https://github.com/julienfalque/xdebug/releases/download/v2.0.0/xdebug \ - && chmod +x /usr/local/bin/xdebug \ - # clean up - && apk del .build-deps + && chmod +x /usr/local/bin/xdebug COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini diff --git a/docker/php-7.2/xdebug.ini b/docker/php-7.2/xdebug.ini index 8ea67c8bebd..cd4b802e88a 100644 --- a/docker/php-7.2/xdebug.ini +++ b/docker/php-7.2/xdebug.ini @@ -1,5 +1,4 @@ ;zend_extension=xdebug.so -xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_host=host.docker.internal -xdebug.remote_port=9003 +xdebug.client_host=host.docker.internal +xdebug.mode=debug +xdebug.start_with_request=yes diff --git a/docker/php-7.3/Dockerfile b/docker/php-7.3/Dockerfile index 512da58aa88..7e337e11289 100644 --- a/docker/php-7.3/Dockerfile +++ b/docker/php-7.3/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.3-cli-alpine3.13 +FROM php:7.3-cli-alpine3.15 ARG DOCKER_USER_ID ARG DOCKER_GROUP_ID @@ -9,19 +9,18 @@ RUN if ! getent group "${DOCKER_GROUP_ID}" > /dev/null; \ && if ! getent passwd "${DOCKER_USER_ID}" > /dev/null; \ then adduser -S -u "${DOCKER_USER_ID}" -G "$(getent group "${DOCKER_GROUP_ID}" | awk -F: '{printf $1}')" dev; \ fi \ - && apk add --no-cache git libxml2-dev openssh-client \ - && apk add --no-cache --virtual .build-deps autoconf g++ make \ - # xdebug - && pecl install xdebug-3.0.1 \ - && docker-php-ext-enable xdebug \ + # php extensions + && curl --location --output /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions \ + && sync \ + && install-php-extensions \ + xdebug-3.1.2 \ # composer && curl --output composer-setup.php https://getcomposer.org/installer \ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php \ # xdebug command && curl --location --output /usr/local/bin/xdebug https://github.com/julienfalque/xdebug/releases/download/v2.0.0/xdebug \ - && chmod +x /usr/local/bin/xdebug \ - # clean up - && apk del .build-deps + && chmod +x /usr/local/bin/xdebug COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini diff --git a/docker/php-7.4/Dockerfile b/docker/php-7.4/Dockerfile index e6a4ab7aa62..ac096309343 100644 --- a/docker/php-7.4/Dockerfile +++ b/docker/php-7.4/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4-cli-alpine3.13 +FROM php:7.4-cli-alpine3.15 ARG DOCKER_USER_ID ARG DOCKER_GROUP_ID @@ -9,19 +9,18 @@ RUN if ! getent group "${DOCKER_GROUP_ID}" > /dev/null; \ && if ! getent passwd "${DOCKER_USER_ID}" > /dev/null; \ then adduser -S -u "${DOCKER_USER_ID}" -G "$(getent group "${DOCKER_GROUP_ID}" | awk -F: '{printf $1}')" dev; \ fi \ - && apk add --no-cache git libxml2-dev openssh-client \ - && apk add --no-cache --virtual .build-deps autoconf g++ make \ - # xdebug - && pecl install xdebug-3.0.1 \ - && docker-php-ext-enable xdebug \ + # php extensions + && curl --location --output /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions \ + && sync \ + && install-php-extensions \ + xdebug-3.1.2 \ # composer && curl --output composer-setup.php https://getcomposer.org/installer \ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php \ # xdebug command && curl --location --output /usr/local/bin/xdebug https://github.com/julienfalque/xdebug/releases/download/v2.0.0/xdebug \ - && chmod +x /usr/local/bin/xdebug \ - # clean up - && apk del .build-deps + && chmod +x /usr/local/bin/xdebug COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini diff --git a/docker/php-8.0/Dockerfile b/docker/php-8.0/Dockerfile index e49c999a5dc..ee487a47afc 100644 --- a/docker/php-8.0/Dockerfile +++ b/docker/php-8.0/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0-cli-alpine3.13 +FROM php:8.0-cli-alpine3.15 ARG DOCKER_USER_ID ARG DOCKER_GROUP_ID @@ -9,19 +9,18 @@ RUN if ! getent group "${DOCKER_GROUP_ID}" > /dev/null; \ && if ! getent passwd "${DOCKER_USER_ID}" > /dev/null; \ then adduser -S -u "${DOCKER_USER_ID}" -G "$(getent group "${DOCKER_GROUP_ID}" | awk -F: '{printf $1}')" dev; \ fi \ - && apk add --no-cache git libxml2-dev openssh-client \ - && apk add --no-cache --virtual .build-deps autoconf g++ make \ - # xdebug - && pecl install xdebug-3.0.1 \ - && docker-php-ext-enable xdebug \ + # php extensions + && curl --location --output /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions \ + && sync \ + && install-php-extensions \ + xdebug-3.1.2 \ # composer && curl --output composer-setup.php https://getcomposer.org/installer \ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php \ # xdebug command && curl --location --output /usr/local/bin/xdebug https://github.com/julienfalque/xdebug/releases/download/v2.0.0/xdebug \ - && chmod +x /usr/local/bin/xdebug \ - # clean up - && apk del .build-deps + && chmod +x /usr/local/bin/xdebug COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini diff --git a/docker/php-7.1/Dockerfile b/docker/php-8.1/Dockerfile similarity index 61% rename from docker/php-7.1/Dockerfile rename to docker/php-8.1/Dockerfile index 326738295ec..dea5b1e4b1b 100644 --- a/docker/php-7.1/Dockerfile +++ b/docker/php-8.1/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.1-cli-alpine3.10 +FROM php:8.1-cli-alpine3.15 ARG DOCKER_USER_ID ARG DOCKER_GROUP_ID @@ -9,19 +9,18 @@ RUN if ! getent group "${DOCKER_GROUP_ID}" > /dev/null; \ && if ! getent passwd "${DOCKER_USER_ID}" > /dev/null; \ then adduser -S -u "${DOCKER_USER_ID}" -G "$(getent group "${DOCKER_GROUP_ID}" | awk -F: '{printf $1}')" dev; \ fi \ - && apk add --no-cache git libxml2-dev openssh-client \ - && apk add --no-cache --virtual .build-deps autoconf g++ make \ - # xdebug - && pecl install xdebug-2.9.8 \ - && docker-php-ext-enable xdebug \ + # php extensions + && curl --location --output /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \ + && chmod +x /usr/local/bin/install-php-extensions \ + && sync \ + && install-php-extensions \ + xdebug-3.1.2 \ # composer && curl --output composer-setup.php https://getcomposer.org/installer \ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php \ # xdebug command - && curl --location --output /usr/local/bin/xdebug https://github.com/julienfalque/xdebug/releases/download/v1.1.0/xdebug \ - && chmod +x /usr/local/bin/xdebug \ - # clean up - && apk del .build-deps + && curl --location --output /usr/local/bin/xdebug https://github.com/julienfalque/xdebug/releases/download/v2.0.0/xdebug \ + && chmod +x /usr/local/bin/xdebug COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini diff --git a/docker/php-8.1/xdebug.ini b/docker/php-8.1/xdebug.ini new file mode 100644 index 00000000000..cd4b802e88a --- /dev/null +++ b/docker/php-8.1/xdebug.ini @@ -0,0 +1,4 @@ +;zend_extension=xdebug.so +xdebug.client_host=host.docker.internal +xdebug.mode=debug +xdebug.start_with_request=yes