Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/7.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'

permissions:
contents: read

jobs:
verify-templating:
name: Verify templating
Expand All @@ -31,14 +34,14 @@ jobs:
runs-on: ubuntu-latest
needs:
- verify-templating
permissions:
contents: read
packages: write
strategy:
matrix:
target:
[
"7_4_30-bullseye",
"7_4_30-buster",
"7_4_30-alpine3_16",
"7_4_30-alpine3_15",
"7_4_33-alpine3_16",
]
steps:
- name: Checkout
Expand All @@ -54,7 +57,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: true
if: false
- name: GHCR Login
uses: docker/login-action@v1
with:
Expand All @@ -66,9 +69,9 @@ jobs:
with:
targets: ${{ matrix.target }}
set: |
*.platform=linux/amd64,linux/arm,linux/arm64
*.platform=linux/amd64
push: ${{ github.event_name == 'push' }}
if: true
if: false
- name: GHCR build and push
uses: docker/bake-action@v2
env:
Expand All @@ -77,5 +80,5 @@ jobs:
with:
targets: ${{ matrix.target }}
set: |
*.platform=linux/amd64,linux/arm,linux/arm64
*.platform=linux/amd64
push: ${{ github.event_name == 'push' }}
15 changes: 0 additions & 15 deletions 7.4/alpine3.15/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions 7.4/alpine3.15/rootfs/usr/local/bin/docker-php-ext-disable

This file was deleted.

4 changes: 2 additions & 2 deletions 7.4/alpine3.16/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NOTE: This file was generated via generate.sh. Don't edit it directly

FROM sunasteriskrnd/php:7.4.30-nginx-alpine3.16
FROM ghcr.io/sun-asterisk-research/php:7.4.33-nginx-alpine3.16@sha256:ccd57c94a1ec0734f926ce55550c528cfabaa4f467a629e77974e61673d32061

ENV COMPOSER_VERSION=2.4.1

Expand All @@ -10,6 +10,6 @@ COPY rootfs /
RUN apk add --no-cache git

RUN apk add --update linux-headers --no-cache --virtual .ext-deps autoconf gcc musl-dev make \
&& pecl install xdebug pcov \
&& pecl install xdebug-3.1.6 pcov-1.0.12 \
&& docker-php-ext-enable xdebug pcov \
&& apk del .ext-deps
15 changes: 0 additions & 15 deletions 7.4/bullseye/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions 7.4/bullseye/rootfs/usr/local/bin/docker-php-ext-disable

This file was deleted.

15 changes: 0 additions & 15 deletions 7.4/buster/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions 7.4/buster/rootfs/usr/local/bin/docker-php-ext-disable

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile-01-alpine.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RUN apk add --no-cache git

RUN apk add --update linux-headers --no-cache --virtual .ext-deps autoconf gcc musl-dev make \
&& pecl install xdebug pcov \
&& docker-php-ext-enable xdebug pcov \
&& pecl install {{ pecl_install }} \
&& docker-php-ext-enable {{ pecl_enable }} \
&& apk del .ext-deps
4 changes: 2 additions & 2 deletions Dockerfile-01-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ RUN apt-get update \
&& apt-get install -y git vim \
&& rm -rf /var/lib/apt/lists/*

RUN pecl install xdebug pcov \
&& docker-php-ext-enable xdebug pcov
RUN pecl install {{ pecl_install }} \
&& docker-php-ext-enable {{ pecl_enable }}
84 changes: 14 additions & 70 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,76 +8,6 @@ variable "REPO" {
default = "sunasteriskrnd/php-dev"
}

target "7_4_30-bullseye" {
context = "./7.4/bullseye"
cache-from = [
"${REGISTRY}/${REPO}:7.4-bullseye"
]
tags = [
"${REGISTRY}/${REPO}:7-bullseye",
"${REGISTRY}/${REPO}:7",
"${REGISTRY}/${REPO}:7.4-bullseye",
"${REGISTRY}/${REPO}:7.4",
"${REGISTRY}/${REPO}:7.4.30-bullseye",
"${REGISTRY}/${REPO}:7.4.30",
]
}

target "7_4-bullseye" {
inherits = ["7_4_30-bullseye"]
}

target "7_4_30-buster" {
context = "./7.4/buster"
cache-from = [
"${REGISTRY}/${REPO}:7.4-buster"
]
tags = [
"${REGISTRY}/${REPO}:7-buster",
"${REGISTRY}/${REPO}:7.4-buster",
"${REGISTRY}/${REPO}:7.4.30-buster",
]
}

target "7_4-buster" {
inherits = ["7_4_30-buster"]
}

target "7_4_30-alpine3_16" {
context = "./7.4/alpine3.16"
cache-from = [
"${REGISTRY}/${REPO}:7.4-alpine3.16"
]
tags = [
"${REGISTRY}/${REPO}:7-alpine3.16",
"${REGISTRY}/${REPO}:7-alpine",
"${REGISTRY}/${REPO}:7.4-alpine3.16",
"${REGISTRY}/${REPO}:7.4-alpine",
"${REGISTRY}/${REPO}:7.4.30-alpine3.16",
"${REGISTRY}/${REPO}:7.4.30-alpine",
]
}

target "7_4-alpine3_16" {
inherits = ["7_4_30-alpine3_16"]
}

target "7_4_30-alpine3_15" {
context = "./7.4/alpine3.15"
cache-from = [
"${REGISTRY}/${REPO}:7.4-alpine3.15"
]
tags = [
"${REGISTRY}/${REPO}:7-alpine3.15",
"${REGISTRY}/${REPO}:7.4-alpine3.15",
"${REGISTRY}/${REPO}:7.4.30-alpine3.15",
]
}

target "7_4-alpine3_15" {
inherits = ["7_4_30-alpine3_15"]
}

target "8_0_22-bullseye" {
context = "./8.0/bullseye"
cache-from = [
Expand Down Expand Up @@ -206,6 +136,20 @@ target "7_3-alpine3_14" {
inherits = ["7_3_33-alpine3_14"]
}

target "7_4_33-alpine3_16" {
context = "./7.4/alpine3.16"
cache-from = [
"${REGISTRY}/${REPO}:7.4-alpine3.16"
]
tags = [
"${REGISTRY}/${REPO}:7.4.33-alpine3.16",
]
}

target "7_4-alpine3_16" {
inherits = ["7_4_33-alpine3_16"]
}

target "8_1_34-alpine3_22" {
context = "./8.1/alpine3.22"
cache-from = [
Expand Down
34 changes: 34 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,32 @@ digest_suffix() {
echo "@sha256:$value"
}

# Print the PECL packages to install: the pecl_packages list from versions*.yml, or "xdebug pcov".
# Each item is a PECL package name with an optional -<version>, e.g. xdebug-3.1.6.
# With --names, print the package names only (version stripped), for docker-php-ext-enable.
#
# Usage: pecl_install_list [--names]
#
pecl_install_list() {
local items
read -ra items <<< "${pecl_packages:-xdebug pcov}"

local item out=()
for item in "${items[@]}"; do
if ! [[ "$item" =~ ^[a-z][a-z0-9_]*(-[0-9][0-9A-Za-z.]*)?$ ]]; then
echo "pecl_packages item must look like xdebug or xdebug-3.1.6, got '$item'" >&2
return 1
fi
if [ "$1" = --names ]; then
out+=("${item%%-*}")
else
out+=("$item")
fi
done

echo "${out[*]}"
}

# Validate the keys of the loaded versions*.yml before anything is written or removed.
# base_image is required; base_image_sha256 is required when exact_tags_only is true,
# so an exact (immutable) tag is never built from an unpinned base.
Expand All @@ -58,6 +84,7 @@ validate_config() {
exact_only=$(bool_key exact_tags_only false) || return 1
bool_key dockerhub_push true > /dev/null || return 1
digest_suffix base_image_sha256 > /dev/null || return 1
pecl_install_list > /dev/null || return 1

if [ "$exact_only" = true ] && [ -z "$base_image_sha256" ]; then
echo "$1: base_image_sha256 is required when exact_tags_only is true" >&2
Expand Down Expand Up @@ -106,6 +133,11 @@ generate_dockerfile() {
local base_image_digest
base_image_digest=$(digest_suffix base_image_sha256)

# PECL packages (optional list key pecl_packages, e.g. xdebug-3.1.6 to pin for an old PHP)
local pecl_install pecl_enable
pecl_install=$(pecl_install_list)
pecl_enable=$(pecl_install_list --names)

mkdir -p "$dir"

write_warn_edit $dockerfile
Expand All @@ -117,6 +149,8 @@ generate_dockerfile() {
distro_release \
base_image \
base_image_digest \
pecl_install \
pecl_enable \
>> $dockerfile
done

Expand Down
1 change: 0 additions & 1 deletion versions.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
php_versions:
- 7.4.30
- 8.0.22

composer_version: 2.4.1
Expand Down
23 changes: 23 additions & 0 deletions versions_7.4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
php_versions:
- 7.4.33

composer_version: 2.4.1
base_image: ghcr.io/sun-asterisk-research/php
base_image_sha256: ccd57c94a1ec0734f926ce55550c528cfabaa4f467a629e77974e61673d32061

pecl_packages:
- xdebug-3.1.6
- pcov-1.0.12

default_php_7_version: 7.4
default_distro: alpine
default_alpine_release: alpine3.16

alpine_releases:
- alpine3.16

platforms:
- linux/amd64

exact_tags_only: true
dockerhub_push: false
Loading