Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
required: false
type: boolean
default: false
debug:
required: false
type: boolean
default: false

jobs:
build-image:
Expand Down Expand Up @@ -59,3 +63,13 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ inputs.push }}
- name: Build and push debug image
if: ${{ inputs.debug == true }}
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
context: ${{ inputs.context }}
file: ${{ inputs.context }}/${{ inputs.dockerfile }}-debug
platforms: ${{ inputs.multiarch == true && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ inputs.push }}
30 changes: 30 additions & 0 deletions .github/workflows/build-php-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build PHP + xdebug images

on:
release:
types:
- created
pull_request:
branches:
- master
paths:
- php/**
- '!php/includes/**'
- .github/workflows/build-image.yml
- .github/workflows/build-php.yml

jobs:
build-php-images:
name: Build PHP + xdebug images
uses: ./.github/workflows/build-image.yml
strategy:
fail-fast: false
matrix:
version: [84, 85]
with:
image: php${{ matrix.version }}
context: ./php
dockerfile: php${{ matrix.version }}/Dockerfile
push: ${{ github.event_name == 'release' }}
debug: true
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/build-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [73, 74, 80, 81, 82, 83, 84, 85]
version: [73, 74, 80, 81, 82, 83]
with:
image: php${{ matrix.version }}
context: ./php
Expand Down
4 changes: 2 additions & 2 deletions compose/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ services:
php-8.4-debug:
build:
context: ./php
dockerfile: php84/Dockerfile
dockerfile: php84/Dockerfile-debug
args:
TIME_ZONE: ${TIME_ZONE}

Expand All @@ -122,7 +122,7 @@ services:
php-8.5-debug:
build:
context: ./php
dockerfile: php85/Dockerfile
dockerfile: php85/Dockerfile-debug
args:
TIME_ZONE: ${TIME_ZONE}

Expand Down
14 changes: 7 additions & 7 deletions compose/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,11 @@ services:
- bash-history:/root/.bash_history
- zsh-history:/root/.zsh_history
- ./shell:/root/custom_shell
depends_on:
- php-8.4-debug
networks:
- totara

php-8.4-debug:
image: ghcr.io/totara/docker-dev-php84
image: ghcr.io/totara/docker-dev-php84-debug
container_name: totara_php84_debug
working_dir: ${REMOTE_SRC}
environment:
Expand All @@ -369,6 +367,8 @@ services:
- ./shell:/root/custom_shell
networks:
- totara
depends_on:
- php-8.4

php-8.5:
image: ghcr.io/totara/docker-dev-php85
Expand All @@ -389,13 +389,11 @@ services:
- bash-history:/root/.bash_history
- zsh-history:/root/.zsh_history
- ./shell:/root/custom_shell
depends_on:
- php-8.5-debug
networks:
- totara
- totara

php-8.5-debug:
image: ghcr.io/totara/docker-dev-php85
image: ghcr.io/totara/docker-dev-php85-debug
container_name: totara_php85_debug
working_dir: ${REMOTE_SRC}
environment:
Expand All @@ -420,6 +418,8 @@ services:
- ./shell:/root/custom_shell
networks:
- totara
depends_on:
- php-8.5

# php-X.X: ...
# php-X.X-debug: ...
Expand Down
5 changes: 0 additions & 5 deletions php/php84/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ RUN pecl channel-update pecl.php.net && \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable pspell

RUN pecl channel-update pecl.php.net && \
pecl install -o -f xdebug-3.4.0 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable xdebug.so

RUN pecl channel-update pecl.php.net && \
pecl install -o -f pcov \
&& rm -rf /tmp/pear \
Expand Down
6 changes: 6 additions & 0 deletions php/php84/Dockerfile-debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ghcr.io/totara/docker-dev-php84

RUN pecl channel-update pecl.php.net && \
pecl install -o -f xdebug-3.4.7 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable xdebug.so
7 changes: 1 addition & 6 deletions php/php85/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libpspell-dev \
xmlstarlet \
libtool \
bison
bison

COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie

Expand Down Expand Up @@ -99,11 +99,6 @@ RUN pecl channel-update pecl.php.net && \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable pspell

RUN pecl channel-update pecl.php.net && \
pecl install -o -f xdebug-3.5.0 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable xdebug.so

RUN pecl channel-update pecl.php.net && \
pecl install -o -f pcov \
&& rm -rf /tmp/pear \
Expand Down
6 changes: 6 additions & 0 deletions php/php85/Dockerfile-debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ghcr.io/totara/docker-dev-php85

RUN pecl channel-update pecl.php.net && \
pecl install -o -f xdebug-3.5.1 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable xdebug.so
Loading