Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker setup #6194

Merged
merged 1 commit into from Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions 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)
Expand All @@ -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
10 changes: 5 additions & 5 deletions 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
Expand All @@ -21,3 +18,6 @@ services:
php-8.0:
<<: *php
build: docker/php-8.0
php-8.1:
<<: *php
build: docker/php-8.1
5 changes: 0 additions & 5 deletions docker/php-7.1/xdebug.ini

This file was deleted.

15 changes: 7 additions & 8 deletions docker/php-7.2/Dockerfile
Expand Up @@ -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
7 changes: 3 additions & 4 deletions 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
17 changes: 8 additions & 9 deletions 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
Expand All @@ -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
17 changes: 8 additions & 9 deletions 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
Expand All @@ -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
17 changes: 8 additions & 9 deletions 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
Expand All @@ -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
19 changes: 9 additions & 10 deletions docker/php-7.1/Dockerfile → 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
Expand All @@ -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
4 changes: 4 additions & 0 deletions 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