Skip to content

Commit

Permalink
minor #6194 Update Docker setup (julienfalque)
Browse files Browse the repository at this point in the history
This PR was merged into the master branch.

Discussion
----------

Update Docker setup

Commits
-------

92cd374 Update Docker setup
  • Loading branch information
SpacePossum committed Dec 20, 2021
2 parents 1f4f55a + 92cd374 commit b317fb7
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 62 deletions.
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

0 comments on commit b317fb7

Please sign in to comment.