initial version

This commit is contained in:
Robin Appelman 2022-03-09 23:04:00 +01:00
commit 41d89d729f
5 changed files with 241 additions and 0 deletions

46
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,46 @@
name: docker-build
on:
push:
branches:
- 'master'
- 'main'
repository_dispatch:
types: [ build ]
jobs:
docker:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1']
steps:
- name: Checkout patch files
uses: actions/checkout@v2
- name: Checkout base dockerfiles
uses: actions/checkout@v2
with:
path: php
repository: docker-library/php
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Patch dockerfiles
run: |
patch -N -p1 -d php < debug.patch
patch -N -p1 -d php < version.patch
cd php; ./apply-templates.sh
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: php/${{ matrix.php-versions }}/bullseye/fpm
push: true
tags: icewind1991/php-dbg:${{ matrix.php-versions }}

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
php

16
build.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
if [ ! -d php ]; then
git clone https://github.com/docker-library/php
fi
patch -N -p1 -d php < debug.patch
patch -N -p1 -d php < version.patch
versions=("7.3" "7.4" "8.0" "8.1")
cd php; ./apply-templates.sh
for version in "${versions[@]}"; do
docker build -t icewind1991/php-debug:$version-fpm -f php/$version/bullseye/fpm/Dockerfile php/$version/bullseye/fpm
done

50
debug.patch Normal file
View file

@ -0,0 +1,50 @@
diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template
index 7c1d6a6..d02925e 100644
--- a/Dockerfile-linux.template
+++ b/Dockerfile-linux.template
@@ -50,6 +50,7 @@ RUN apk add --no-cache \
curl \
tar \
xz \
+ gdb \
# https://github.com/docker-library/php/issues/494
openssl
@@ -71,6 +72,7 @@ RUN set -eux; \
ca-certificates \
curl \
xz-utils \
+ gdb \
; \
rm -rf /var/lib/apt/lists/*
{{ ) end -}}
@@ -332,6 +334,7 @@ RUN set -eux; \
--with-openssl \
--with-readline \
--with-zlib \
+ --enable-debug \
\
{{ if env.variant == "cli" then ( -}}
# https://github.com/docker-library/php/pull/1259
@@ -385,21 +388,12 @@ RUN set -eux; \
make -j "$(nproc)"; \
find -type f -name '*.a' -delete; \
make install; \
- find \
- /usr/local \
- -type f \
- -perm '/0111' \
- -exec sh -euxc ' \
- strip --strip-all "$@" || : \
- ' -- '{}' + \
- ; \
make clean; \
\
# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
cp -v php.ini-* "$PHP_INI_DIR/"; \
\
cd /; \
- docker-php-source delete; \
\
{{ if is_alpine then ( -}}
runDeps="$( \

128
version.patch Normal file
View file

@ -0,0 +1,128 @@
diff --git a/versions.json b/versions.json
index be496aa..37a495a 100644
--- a/versions.json
+++ b/versions.json
@@ -4,20 +4,7 @@
"sha256": "166eaccde933381da9516a2b70ad0f447d7cec4b603d07b9a916032b215b90cc",
"url": "https://www.php.net/distributions/php-7.3.33.tar.xz",
"variants": [
- "bullseye/cli",
- "bullseye/apache",
- "bullseye/fpm",
- "bullseye/zts",
- "buster/cli",
- "buster/apache",
- "buster/fpm",
- "buster/zts",
- "alpine3.15/cli",
- "alpine3.15/fpm",
- "alpine3.15/zts",
- "alpine3.14/cli",
- "alpine3.14/fpm",
- "alpine3.14/zts"
+ "bullseye/fpm"
],
"version": "7.3.33"
},
@@ -27,20 +14,7 @@
"sha256": "9cc3b6f6217b60582f78566b3814532c4b71d517876c25013ae51811e65d8fce",
"url": "https://www.php.net/distributions/php-7.4.28.tar.xz",
"variants": [
- "bullseye/cli",
- "bullseye/apache",
- "bullseye/fpm",
- "bullseye/zts",
- "buster/cli",
- "buster/apache",
- "buster/fpm",
- "buster/zts",
- "alpine3.15/cli",
- "alpine3.15/fpm",
- "alpine3.15/zts",
- "alpine3.14/cli",
- "alpine3.14/fpm",
- "alpine3.14/zts"
+ "bullseye/fpm"
],
"version": "7.4.28"
},
@@ -50,18 +24,7 @@
"sha256": "f27a2f25259e8c51e42dfd74e24a546ee521438ad7d9f6c6e794aa91f38bab0a",
"url": "https://www.php.net/distributions/php-8.0.16.tar.xz",
"variants": [
- "bullseye/cli",
- "bullseye/apache",
- "bullseye/fpm",
- "bullseye/zts",
- "buster/cli",
- "buster/apache",
- "buster/fpm",
- "buster/zts",
- "alpine3.15/cli",
- "alpine3.15/fpm",
- "alpine3.14/cli",
- "alpine3.14/fpm"
+ "bullseye/fpm"
],
"version": "8.0.16"
},
@@ -70,18 +33,7 @@
"sha256": "8e8870fffbb0cabc76ee17f36bd6b2532401fe8dae49a4cb763860499420b06d",
"url": "https://downloads.php.net/~carusogabriel/php-8.0.17RC1.tar.xz",
"variants": [
- "bullseye/cli",
- "bullseye/apache",
- "bullseye/fpm",
- "bullseye/zts",
- "buster/cli",
- "buster/apache",
- "buster/fpm",
- "buster/zts",
- "alpine3.15/cli",
- "alpine3.15/fpm",
- "alpine3.14/cli",
- "alpine3.14/fpm"
+ "bullseye/fpm"
],
"version": "8.0.17RC1"
},
@@ -90,18 +42,7 @@
"sha256": "5d65a11071b47669c17452fb336c290b67c101efb745c1dbe7525b5caf546ec6",
"url": "https://www.php.net/distributions/php-8.1.3.tar.xz",
"variants": [
- "bullseye/cli",
- "bullseye/apache",
- "bullseye/fpm",
- "bullseye/zts",
- "buster/cli",
- "buster/apache",
- "buster/fpm",
- "buster/zts",
- "alpine3.15/cli",
- "alpine3.15/fpm",
- "alpine3.14/cli",
- "alpine3.14/fpm"
+ "bullseye/fpm"
],
"version": "8.1.3"
},
@@ -110,18 +51,7 @@
"sha256": "e7f0a54823940765f2b56ccfb7a045b4897d4277643a6a8145551b7deecd0797",
"url": "https://downloads.php.net/~patrickallaert/php-8.1.4RC1.tar.xz",
"variants": [
- "bullseye/cli",
- "bullseye/apache",
- "bullseye/fpm",
- "bullseye/zts",
- "buster/cli",
- "buster/apache",
- "buster/fpm",
- "buster/zts",
- "alpine3.15/cli",
- "alpine3.15/fpm",
- "alpine3.14/cli",
- "alpine3.14/fpm"
+ "bullseye/fpm"
],
"version": "8.1.4RC1"
}