Skip to content

Commit

Permalink
Use PECL for PHP 8.0 image. Use the second version of composer. (#1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidz committed Apr 26, 2021
1 parent d72c1f0 commit bfc0fc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 4 additions & 2 deletions devTools/Dockerfile-php74-xdebug
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM php:7.4-cli-alpine

ARG XDEBUG_VERSION=3.0.4

RUN set -eux; \
apk add --no-cache --virtual .build-deps \
${PHPIZE_DEPS} \
build-base \
; \
pecl install xdebug; \
pecl install xdebug-${XDEBUG_VERSION}; \
pecl clear-cache; \
docker-php-ext-enable xdebug ;\
runDeps="$( \
Expand All @@ -25,7 +27,7 @@ RUN apk add --no-cache \
git \
zip

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY devTools/memory-limit.ini devTools/xdebug-coverage.ini ${PHP_INI_DIR}/conf.d/

RUN adduser -h /opt/infection -s /bin/bash -D infection
Expand Down
9 changes: 4 additions & 5 deletions devTools/Dockerfile-php80-xdebug
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
FROM php:8.0-cli-alpine

ARG XDEBUG_VERSION=3.0.1
ARG XDEBUG_VERSION=3.0.4

RUN set -eux; \
apk add --no-cache --virtual .build-deps \
${PHPIZE_DEPS} \
build-base \
; \
mkdir -p /usr/src/php/ext/xdebug && curl -fsSL https://pecl.php.net/get/xdebug-${XDEBUG_VERSION} | tar -xvz -C "/usr/src/php/ext/xdebug" --strip 1; \
docker-php-ext-install -j$(nproc) xdebug; \
pecl install xdebug-${XDEBUG_VERSION}; \
pecl clear-cache; \
docker-php-ext-enable xdebug ;\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
rm -rf /usr/src/php; \
apk add --no-cache --virtual .phpexts-rundeps ${runDeps}; \
apk del .build-deps

Expand All @@ -27,7 +26,7 @@ RUN apk add --no-cache \
expect \
zip

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
COPY devTools/memory-limit.ini devTools/xdebug-coverage.ini ${PHP_INI_DIR}/conf.d/

RUN adduser -h /opt/infection -s /bin/bash -D infection
Expand Down

0 comments on commit bfc0fc5

Please sign in to comment.