Compare commits

...

19 Commits

Author SHA1 Message Date
renovate[bot]
ced5201b92 chore(actions): update ivuorinen/actions action (v2026.03.11 → v2026.03.14) (#91)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-16 08:17:10 +02:00
renovate[bot]
60490faa45 chore(actions): update ivuorinen/actions action (v2026.03.02 → v2026.03.11) (#90)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-13 05:02:13 +00:00
renovate[bot]
da03789da4 chore(actions): update actions/download-artifact action (v8.0.0 → v8.0.1) (#89)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-13 04:59:33 +00:00
renovate[bot]
9f78b42ea7 chore(deps)!: update docker/build-push-action (v6.19.2 → v7.0.0) (#88) 2026-03-05 23:44:03 +02:00
renovate[bot]
2c4e3091ee chore(deps)!: update docker/metadata-action (v5.10.0 → v6.0.0) (#87) 2026-03-05 23:31:49 +02:00
renovate[bot]
4ac5f4822f chore(deps)!: update docker/setup-buildx-action (v3.12.0 → v4.0.0) (#86) 2026-03-05 22:17:57 +02:00
renovate[bot]
4279d9fcce chore(deps)!: update docker/login-action (v3.7.0 → v4.0.0) (#85)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-05 12:18:36 +02:00
renovate[bot]
234abcddfb chore(deps): update ivuorinen/actions action (v2026.02.28 → v2026.03.02) (#84)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-04 08:45:53 +00:00
renovate[bot]
1d80e8708f chore(deps): update ivuorinen/actions action (v2026.02.24 → v2026.02.28) (#83)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-02 03:40:37 +02:00
5c23d3dcad feat: add CI path filters and expand README (#82) 2026-02-27 08:31:31 +02:00
92cb1405fa feat: add PHP 8.5 support and improve CI builds (#81)
* fix(renovate): pin PHP base images to digest-only updates

* feat(php85): add PHP 8.5 with Imagick and Composer

* ci: add php85 to build and PR matrices

* docs: update supported PHP version range to 8.5

* ci: enable GHA build cache for Docker image builds

* fix: address CR feedback — fix DOCKERFILE_PATH, renovate match, composer verify, drop python3-dev

* ci: use native arm64 runners for arm64 Docker builds

* ci: use build-by-digest with manifest merge for multi-arch images

Switch from direct per-arch push to a two-phase workflow:
1. Build phase pushes images by digest and uploads artifacts
2. Merge phase creates multi-arch manifest lists per PHP version

This ensures proper multi-arch manifest tags instead of
last-writer-wins race conditions between arch builds.

* fix: remove continue-on-error and suppress SC2046 shellcheck warning

Remove continue-on-error from build job so failed arch builds correctly
block the merge job from pushing incomplete manifests. Add shellcheck
disable directive for intentional word-splitting in manifest creation.
2026-02-27 04:28:05 +02:00
99d3e25d43 fix: add yamllint config and remove trailing blank line in pr-build.yml (#80)
Add root .yamllint.yml with relaxed rules matching the megalinter config
and disable the truthy rule that flags `on:` in GitHub Actions workflows.
Remove trailing blank line from pr-build.yml.
2026-02-27 02:14:36 +02:00
renovate[bot]
85bb129057 chore(deps)!: update actions/download-artifact (v7.0.0 → v8.0.0) (#78)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 01:18:17 +02:00
renovate[bot]
f724055fec chore(deps)!: update actions/upload-artifact (v6.0.0 → v7.0.0) (#79)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 01:17:42 +02:00
renovate[bot]
c537df409f chore(deps): update ivuorinen/actions action (v2026.02.18 → v2026.02.24) (#77)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-26 06:10:02 +00:00
renovate[bot]
96c7e7b64f chore(deps): update ivuorinen/actions action (v2026.02.10 → v2026.02.18) (#76)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-20 04:56:05 +00:00
renovate[bot]
dd903ba508 chore(deps): update docker/build-push-action action (v6.18.0 → v6.19.2) (#75)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-13 20:32:26 +00:00
renovate[bot]
1cf486fb40 chore(deps): update ivuorinen/actions action (v2026.02.03 → v2026.02.10) (#74)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-12 16:29:25 +02:00
renovate[bot]
8554d086d1 chore(deps): update ivuorinen/actions action (v2026.01.21 → v2026.02.03) (#73)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-05 09:26:04 +02:00
7 changed files with 255 additions and 22 deletions

11
.github/renovate.json vendored
View File

@@ -1,4 +1,13 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>ivuorinen/renovate-config"] "extends": ["github>ivuorinen/renovate-config"],
"packageRules": [
{
"description": "Only allow digest updates for PHP base images, not version upgrades",
"matchDatasources": ["docker"],
"matchPackageNames": ["php", "library/php"],
"matchUpdateTypes": ["major", "minor", "patch"],
"enabled": false
}
]
} }

View File

@@ -7,6 +7,9 @@ on:
- cron: "0 2 * * 1" # At 2:00 on Monday. - cron: "0 2 * * 1" # At 2:00 on Monday.
push: push:
branches: ["main"] branches: ["main"]
paths:
- "**/Dockerfile"
- ".github/workflows/**"
workflow_dispatch: workflow_dispatch:
env: env:
@@ -18,9 +21,8 @@ env:
permissions: read-all permissions: read-all
jobs: jobs:
BuildAndRelease: build:
runs-on: ubuntu-latest runs-on: ${{ matrix.arch == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
continue-on-error: true
permissions: permissions:
contents: read contents: read
packages: write packages: write
@@ -28,26 +30,90 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
php: [php74, php80, php81, php82, php83, php84] php: [php74, php80, php81, php82, php83, php84, php85]
arch: ["linux/amd64", "linux/arm64"] arch: ["linux/amd64", "linux/arm64"]
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push (${{ matrix.php }} / ${{ matrix.arch }}) - name: Determine platform pair
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 id: platform
run: |
echo "pair=$(echo '${{ matrix.arch }}' | tr '/' '-')" >> "$GITHUB_OUTPUT"
- name: Build and push by digest
id: build
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with: with:
file: ${{ matrix.php }}/Dockerfile file: ${{ matrix.php }}/Dockerfile
platforms: ${{ matrix.arch }} platforms: ${{ matrix.arch }}
push: true outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.php }} cache-from: type=gha,scope=${{ matrix.php }}-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.php }}-${{ matrix.arch }}
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: digests-${{ matrix.php }}-${{ steps.platform.outputs.pair }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
php: [php74, php80, php81, php82, php83, php84, php85]
steps:
- name: Download digests
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: /tmp/digests
pattern: digests-${{ matrix.php }}-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log in to the Container registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
# shellcheck disable=SC2046
docker buildx imagetools create \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.php }} \
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.php }}

View File

@@ -5,6 +5,9 @@ name: PR Build and Report
on: on:
pull_request: pull_request:
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
paths:
- "**/Dockerfile"
- ".github/workflows/**"
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@@ -21,7 +24,7 @@ permissions: read-all
jobs: jobs:
pr-build: pr-build:
name: PR Build name: PR Build
runs-on: ubuntu-latest runs-on: ${{ matrix.arch == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
timeout-minutes: 30 timeout-minutes: 30
permissions: permissions:
@@ -33,7 +36,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
php: [php74, php80, php81, php82, php83, php84] php: [php74, php80, php81, php82, php83, php84, php85]
arch: ["linux/amd64", "linux/arm64"] arch: ["linux/amd64", "linux/arm64"]
steps: steps:
@@ -49,10 +52,10 @@ jobs:
echo "tag_arch=$TAG_ARCH" >> "$GITHUB_OUTPUT" echo "tag_arch=$TAG_ARCH" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
@@ -60,7 +63,7 @@ jobs:
- name: Docker metadata - name: Docker metadata
id: meta id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.php }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.php }}
tags: | tags: |
@@ -69,7 +72,7 @@ jobs:
- name: Extract base image - name: Extract base image
id: baseimage id: baseimage
run: | run: |
BASE_IMAGE="$(grep -m1 '^FROM ' ${{ env.DOCKERFILE_PATH }} | awk '{print $2}')" BASE_IMAGE="$(grep -m1 '^FROM ' ./${{ matrix.php }}/Dockerfile | awk '{print $2}')"
echo "base_image=$BASE_IMAGE" >> "$GITHUB_OUTPUT" echo "base_image=$BASE_IMAGE" >> "$GITHUB_OUTPUT"
- name: Build Docker image (capture cache usage) - name: Build Docker image (capture cache usage)
@@ -82,6 +85,8 @@ jobs:
docker buildx build \ docker buildx build \
--platform ${{ matrix.arch }} \ --platform ${{ matrix.arch }} \
--tag "$IMAGE_TAG" \ --tag "$IMAGE_TAG" \
--cache-from type=gha,scope=${{ matrix.php }}-${{ matrix.arch }} \
--cache-to type=gha,mode=max,scope=${{ matrix.php }}-${{ matrix.arch }} \
--progress plain \ --progress plain \
--load ./${{ matrix.php }}/ | tee build.log --load ./${{ matrix.php }}/ | tee build.log
END="$(date +%s)" END="$(date +%s)"
@@ -130,7 +135,7 @@ jobs:
mv ${{ steps.resultfile.outputs.filename }} results/ mv ${{ steps.resultfile.outputs.filename }} results/
- name: Upload build result - name: Upload build result
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with: with:
name: build-results-${{ steps.resultfile.outputs.filename }} name: build-results-${{ steps.resultfile.outputs.filename }}
path: results/ path: results/
@@ -152,7 +157,7 @@ jobs:
steps: steps:
- name: Download all build results - name: Download all build results
id: dl id: dl
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with: with:
path: results path: results
@@ -188,4 +193,3 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }} issue-number: ${{ github.event.pull_request.number }}
body-file: comment.md body-file: comment.md

View File

@@ -5,8 +5,20 @@ name: Lint Code Base
on: on:
push: push:
branches: [master, main] branches: [master, main]
paths:
- "**/Dockerfile"
- ".github/workflows/**"
- ".mega-linter.yml"
- ".hadolint.yaml"
- ".yamllint.yml"
pull_request: pull_request:
branches: [master, main] branches: [master, main]
paths:
- "**/Dockerfile"
- ".github/workflows/**"
- ".mega-linter.yml"
- ".hadolint.yaml"
- ".yamllint.yml"
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@@ -29,4 +41,4 @@ jobs:
steps: steps:
- name: Run PR Lint - name: Run PR Lint
# https://github.com/ivuorinen/actions # https://github.com/ivuorinen/actions
uses: ivuorinen/actions/pr-lint@f98ae7cd7d0feb1f9d6b01de0addbb11414cfc73 # v2026.01.21 uses: ivuorinen/actions/pr-lint@1da3a0e79fcd7da6bed9ee1979f1449ba11f58f9 # v2026.03.14

13
.yamllint.yml Normal file
View File

@@ -0,0 +1,13 @@
---
extends: default
rules:
braces:
max-spaces-inside: 1
new-lines:
level: warning
type: unix
line-length:
max: 500
comments:
min-spaces-from-content: 1
truthy: disable

View File

@@ -1,3 +1,89 @@
# docker-php-with-imagick-multi # docker-php-with-imagick-multi
PHP 7.4-8.4 with imagick for arm64 and amd64 [![Build](https://github.com/ivuorinen/docker-php-with-imagick-multi/actions/workflows/docker-image.yml/badge.svg)](https://github.com/ivuorinen/docker-php-with-imagick-multi/actions/workflows/docker-image.yml)
[![License](https://img.shields.io/github/license/ivuorinen/docker-php-with-imagick-multi)](https://github.com/ivuorinen/docker-php-with-imagick-multi)
[![Last Commit](https://img.shields.io/github/last-commit/ivuorinen/docker-php-with-imagick-multi)](https://github.com/ivuorinen/docker-php-with-imagick-multi/commits/main)
Multi-architecture Docker images for PHP 7.4 through 8.5 with Imagick and Composer pre-installed.
## Available Images
| PHP Version | Tag | Pull Command |
| ----------- | ------- | ------------------------------------------------------------------- |
| PHP 7.4 | `php74` | `docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php74` |
| PHP 8.0 | `php80` | `docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php80` |
| PHP 8.1 | `php81` | `docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php81` |
| PHP 8.2 | `php82` | `docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php82` |
| PHP 8.3 | `php83` | `docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php83` |
| PHP 8.4 | `php84` | `docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php84` |
| PHP 8.5 | `php85` | `docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php85` |
## Architectures
- `linux/amd64`
- `linux/arm64`
## Included Software
### PHP Extensions
| Extension | Description |
| ---------- | ---------------------------------- |
| bcmath | Arbitrary precision mathematics |
| intl | Internationalization (ICU) |
| mbstring | Multibyte string handling |
| pdo | PHP Data Objects database layer |
| xml | XML parsing and manipulation |
| gd | Image processing (freetype + jpeg) |
| exif | Image metadata reading |
| pcntl | Process control |
| imagick | ImageMagick bindings (via PECL) |
### System Libraries
| Library | Purpose |
| ------------------ | --------------------------- |
| libicu-dev | ICU for intl extension |
| libxml2-dev | XML parsing |
| libfreetype6-dev | Font rendering (GD) |
| libjpeg62-turbo-dev| JPEG support (GD) |
| libpng-dev | PNG support (GD) |
| libonig-dev | Oniguruma regex (mbstring) |
| libmagickwand-dev | ImageMagick C API (imagick) |
### Tools
- **Composer** (latest, installed to `/usr/local/bin/composer`)
## Usage
Pull an image:
```sh
docker pull ghcr.io/ivuorinen/docker-php-with-imagick-multi:php84
```
Run a container:
```sh
docker run --rm ghcr.io/ivuorinen/docker-php-with-imagick-multi:php84 php -v
```
Use as a base image in your Dockerfile:
```dockerfile
FROM ghcr.io/ivuorinen/docker-php-with-imagick-multi:php84
COPY . /app
WORKDIR /app
RUN composer install --no-dev
```
## Building Locally
```sh
docker build -t my-php84 ./php84/
```
## License
See [LICENSE](LICENSE) for details.

43
php85/Dockerfile Normal file
View File

@@ -0,0 +1,43 @@
# vim: set ft=dockerfile ts=2 sw=2 sts=2 et:
FROM php:8.5@sha256:2d7a7e055947c398314250fb6d657c85979872c44ce9912b9dc9d1456439b0b3
LABEL \
maintainer="Ismo Vuorinen <ismo@ivuorinen.net>" \
version="1.0" \
description="PHP 8.5 with Imagick and Composer"
# Install PHP extensions and required libraries
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
libicu-dev \
libxml2-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libonig-dev \
libmagickwand-dev \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
bcmath \
intl \
mbstring \
pdo \
xml \
gd \
exif \
&& docker-php-ext-configure pcntl \
&& docker-php-ext-install pcntl \
&& yes '' | pecl install imagick \
&& docker-php-ext-enable imagick \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sS -o composer-setup.php https://getcomposer.org/installer \
&& EXPECTED_HASH="$(curl -sS https://composer.github.io/installer.sig)" \
&& ACTUAL_HASH="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" \
&& if [ "$EXPECTED_HASH" != "$ACTUAL_HASH" ]; then echo 'Composer installer corrupt'; rm composer-setup.php; exit 1; fi \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
&& rm composer-setup.php \
&& php --version \
&& composer --version