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
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
strategy:
matrix:
include:
- php_version: '8.4'
php_target: '8_4'
- php_version: '8.5'
php_target: '8_5'
- name: Login to DockerHub
uses: docker/login-action@v3
with:
Expand All @@ -26,8 +32,8 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
- name: Build and push PHP ${{ matrix.php_version }}
uses: docker/bake-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
targets: image-all
targets: dev-${{ matrix.php_version }}-all,prod-${{ matrix.php_version }}-all
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
build:
docker buildx bake --pull

build-8.4:
docker buildx bake --pull dev-8_4-local prod-8_4-local

build-8.5:
docker buildx bake --pull dev-8_5-local prod-8_5-local

build-all:
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx bake --pull image-all
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Pre-configured Docker image that follows [Le Phare](https://www.lephare.com) pro
| Version | Supported until |
|---------|-----------------|
| 8.4 | 31 Dec. 2028 |
| 8.5 | 31 Dec. 2029 |

## Environment variables

Expand All @@ -15,3 +16,41 @@ Pre-configured Docker image that follows [Le Phare](https://www.lephare.com) pro
- `CADDY_FRANKENPHP_WORKER_CONFIG`
- `CADDY_STATIC_ERROR_PAGES_PATH`
- `CADDY_TRUSTED_PROXIES`

## Docker Image Tags

### PHP 8.5 (default)
- `lephare/frankenphp:latest` or `lephare/frankenphp:8.5` - Production image
- `lephare/frankenphp:prod` or `lephare/frankenphp:8.5-prod` - Production image (alias)
- `lephare/frankenphp:dev` or `lephare/frankenphp:8.5-dev` - Development image

### PHP 8.4
- `lephare/frankenphp:8.4` - Production image
- `lephare/frankenphp:8.4-prod` - Production image (alias)
- `lephare/frankenphp:8.4-dev` - Development image

## PHP Extensions

Both PHP 8.4 and 8.5 images include the following extensions:
- @composer
- apcu
- exif
- gd
- intl
- memcached
- opcache
- pdo_mysql
- pdo_pgsql
- pgsql
- soap
- zip

**PHP 8.5 Limitations:** The following extensions are **not available in PHP 8.5** images due to compatibility issues:
- `imagick` - Image manipulation library
- `xdebug` - Debugging extension (not available in dev images)

If you require these extensions, please use the PHP 8.4 images.

**PHP 8.4 only:** Development images (8.4-dev) include:
- xdebug

4 changes: 3 additions & 1 deletion base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# syntax=docker/dockerfile:1
# check=error=true

FROM dunglas/frankenphp:1-php8.4
ARG PHP_VERSION=8.5

FROM dunglas/frankenphp:1-php${PHP_VERSION}

WORKDIR /var/www/symfony

Expand Down
5 changes: 4 additions & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

ARG PHP_EXTENSIONS

RUN set -eux; install-php-extensions ${PHP_EXTENSIONS}
RUN set -eux; \
if [ -n "${PHP_EXTENSIONS}" ]; then \
install-php-extensions ${PHP_EXTENSIONS}; \
fi

USER php

Expand Down
108 changes: 86 additions & 22 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
variable "PHP_VERSION" {
default = "8.4"
}

variable "REPO" {
default = "lephare/frankenphp"
}
Expand All @@ -10,68 +6,136 @@ variable "REPO" {
target "docker-metadata-action" {}

group "default" {
targets = ["dev-local", "prod-local"]
targets = ["dev-8_5-local", "prod-8_5-local"]
}

group "image-all" {
targets = ["dev-all", "prod-all"]
targets = ["dev-8_4-all", "prod-8_4-all", "dev-8_5-all", "prod-8_5-all"]
}

target "base" {
// PHP 8.4 targets
target "base-8_4" {
inherits = ["docker-metadata-action"]
args = {
PHP_VERSION = "8.4"
PHP_EXTENSIONS = "@composer apcu exif gd imagick intl memcached opcache pdo_mysql pdo_pgsql pgsql soap zip"
}
dockerfile = "base.Dockerfile"
}

target "dev" {
target "dev-8_4" {
inherits = ["docker-metadata-action"]
args = {
PHP_EXTENSIONS = "xdebug"
}
contexts = {
base = "target:base"
base = "target:base-8_4"
}
dockerfile = "dev.Dockerfile"
tags = [
"${REPO}:8.4-dev",
]
}

target "dev-8_4-local" {
inherits = ["dev-8_4"]
output = ["type=docker"]
}

target "dev-8_4-all" {
inherits = ["dev-8_4"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}

target "prod-8_4" {
inherits = ["docker-metadata-action"]
contexts = {
base = "target:base-8_4"
}
dockerfile = "prod.Dockerfile"
tags = [
"${REPO}:8.4-prod",
"${REPO}:8.4",
]
}

target "prod-8_4-local" {
inherits = ["prod-8_4"]
output = ["type=docker"]
}

target "prod-8_4-all" {
inherits = ["prod-8_4"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}

// PHP 8.5 targets (default)
target "base-8_5" {
inherits = ["docker-metadata-action"]
args = {
PHP_VERSION = "8.5"
PHP_EXTENSIONS = "@composer apcu exif gd intl memcached opcache pdo_mysql pdo_pgsql pgsql soap zip"
}
dockerfile = "base.Dockerfile"
}

target "dev-8_5" {
inherits = ["docker-metadata-action"]
args = {
PHP_EXTENSIONS = ""
}
contexts = {
base = "target:base-8_5"
}
dockerfile = "dev.Dockerfile"
tags = [
"${REPO}:${PHP_VERSION}-dev",
"${REPO}:8.5-dev",
"${REPO}:dev",
]
}

target "dev-local" {
inherits = ["dev"]
target "dev-8_5-local" {
inherits = ["dev-8_5"]
output = ["type=docker"]
}

target "dev-all" {
inherits = ["dev"]
target "dev-8_5-all" {
inherits = ["dev-8_5"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}

target "prod" {
target "prod-8_5" {
inherits = ["docker-metadata-action"]
contexts = {
base = "target:base"
base = "target:base-8_5"
}
dockerfile = "prod.Dockerfile"
tags = [
"${REPO}:${PHP_VERSION}-prod",
"${REPO}:8.5-prod",
"${REPO}:prod",
"${REPO}:${PHP_VERSION}",
"${REPO}:8.5",
"${REPO}:latest",
]
}

target "prod-local" {
inherits = ["prod"]
target "prod-8_5-local" {
inherits = ["prod-8_5"]
output = ["type=docker"]
}

target "prod-all" {
inherits = ["prod"]
target "prod-8_5-all" {
inherits = ["prod-8_5"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}