Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add php 8.4 support #108

Merged
merged 1 commit into from
Nov 22, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os_name: ["alpine"]
php_version: ["8.1", "8.2", "8.3"]
php_version: ["8.1", "8.2", "8.3", "8.4"]
php_type: ["fpm", "cli", "supervisord"]
builder: [{arch: "amd64", os: "ubuntu-latest"}, {arch: "arm64", os: "ubuntu-latest"}]
runs-on: ${{ matrix.builder.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os_name: ["alpine"]
php_version: ["8.1", "8.2", "8.3"]
php_version: ["8.1", "8.2", "8.3", "8.4"]
php_type: ["fpm", "cli", "supervisord"]
builder: [{arch: "amd64", os: "ubuntu-latest"}]
runs-on: ${{ matrix.builder.os }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export COMPOSE_DOCKER_CLI_BUILD ?= 1
DOCKER ?= docker

IMAGE_NAMESPACE ?= wayofdev/php-base
IMAGE_TEMPLATE ?= 8.3-fpm-alpine
IMAGE_TEMPLATE ?= 8.4-fpm-alpine
IMAGE_TAG ?= $(IMAGE_NAMESPACE):$(IMAGE_TEMPLATE)-latest

DOCKERFILE_DIR ?= ./dist/base/$(IMAGE_TEMPLATE)
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

The `docker-php-base` project is a **system** for creating and maintaining **PHP Docker images**.

It uses **Ansible** to generate **Dockerfiles** for multiple PHP versions (7.4, 8.0, **8.1, 8.2, 8.3**) and types (**CLI, FPM, Supervisord**) on **Alpine Linux**.
It uses **Ansible** to generate **Dockerfiles** for multiple PHP versions (7.4, 8.0, **8.1, 8.2, 8.3, 8.4**) and types (**CLI, FPM, Supervisord**) on **Alpine Linux**.

The project automates the build process using **GitHub Actions**, creating multi-architecture images (**AMD64** and **ARM64**) that are tested with [goss](https://github.com/goss-org/goss).

Expand All @@ -37,7 +37,7 @@ If you **like/use** this package, please consider ⭐️ **starring** it. Thanks

## 🚀 Features

- **Multiple PHP Versions:** Supports PHP 7.4, 8.0, 8.1, 8.2, and 8.3.
- **Multiple PHP Versions:** Supports PHP 7.4, 8.0, 8.1, 8.2, 8.3 and **8.4**.
- **Various PHP Types:** Includes CLI, FPM, and Supervisord configurations.
- **Alpine-based:** Lightweight images built on Alpine Linux.
- **Pre-configured Extensions:** Comes with a wide range of pre-installed PHP extensions.
Expand All @@ -57,7 +57,7 @@ If you **like/use** this package, please consider ⭐️ **starring** it. Thanks
- **GitHub Actions:** CI/CD pipeline for automated building, testing, and publishing.
- **dgoss:** For Docker image testing.
- **Alpine Linux:** Base OS for the Docker images.
- **PHP:** Core language with multiple versions (7.4, 8.0, 8.1, 8.2, 8.3).
- **PHP:** Core language with multiple versions (7.4, 8.0, 8.1, 8.2, 8.3, 8.4).

<br>

Expand Down Expand Up @@ -109,7 +109,7 @@ Replace `8.3-fpm-alpine-latest` with your desired PHP version, type, and tag.

The images are available in various combinations of PHP versions, types, and architectures:

- **PHP Versions:** 8.1, 8.2, 8.3
- **PHP Versions:** 8.1, 8.2, 8.3, 8.4
- **Types:** cli, fpm, supervisord
- **Architectures:** amd64, arm64

Expand Down Expand Up @@ -203,6 +203,9 @@ make generate
make build IMAGE_TEMPLATE="8.3-cli-alpine"
make build IMAGE_TEMPLATE="8.3-fpm-alpine"
make build IMAGE_TEMPLATE="8.3-supervisord-alpine"
make build IMAGE_TEMPLATE="8.4-cli-alpine"
make build IMAGE_TEMPLATE="8.4-fpm-alpine"
make build IMAGE_TEMPLATE="8.4-supervisord-alpine"
```

These commands will build all supported image variants.
Expand Down Expand Up @@ -303,6 +306,9 @@ You can run tests using the following commands:
make test IMAGE_TEMPLATE="8.3-cli-alpine"
make test IMAGE_TEMPLATE="8.3-fpm-alpine"
make test IMAGE_TEMPLATE="8.3-supervisord-alpine"
make test IMAGE_TEMPLATE="8.4-cli-alpine"
make test IMAGE_TEMPLATE="8.4-fpm-alpine"
make test IMAGE_TEMPLATE="8.4-supervisord-alpine"
```

### → Test Configuration
Expand Down
32 changes: 32 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ target "php-83-supervisord-alpine" {
dockerfile = "./Dockerfile"
}

###########################
## PHP 8.4
###########################
target "php-84-cli-alpine" {
inherits = ["docker-metadata-action"]
context = "dist/base/8.4-cli-alpine"
dockerfile = "./Dockerfile"
}

target "php-84-fpm-alpine" {
inherits = ["docker-metadata-action"]
context = "dist/base/8.4-fpm-alpine"
dockerfile = "./Dockerfile"
}

target "php-84-supervisord-alpine" {
inherits = ["docker-metadata-action"]
context = "dist/base/8.4-supervisord-alpine"
dockerfile = "./Dockerfile"
}

group "all" {
targets = [
"php-81-cli-alpine",
Expand All @@ -82,6 +103,9 @@ group "all" {
"php-83-cli-alpine",
"php-83-fpm-alpine",
"php-83-supervisord-alpine",
"php-84-cli-alpine",
"php-84-fpm-alpine",
"php-84-supervisord-alpine",
]
}

Expand All @@ -108,3 +132,11 @@ group "php-83" {
"php-83-supervisord-alpine",
]
}

group "php-84" {
targets = [
"php-84-cli-alpine",
"php-84-fpm-alpine",
"php-84-supervisord-alpine",
]
}
22 changes: 22 additions & 0 deletions src/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,27 @@ all:
php_type: supervisord
os_name: alpine
os_version: 3.20
# PHP 8.4
8.4-cli-alpine:
ansible_connection: local
level: base
php_version: 8.4
php_type: cli
os_name: alpine
os_version: 3.20
8.4-fpm-alpine:
ansible_connection: local
level: base
php_version: 8.4
php_type: fpm
os_name: alpine
os_version: 3.20
8.4-supervisord-alpine:
ansible_connection: local
level: base
php_version: 8.4
php_type: supervisord
os_name: alpine
os_version: 3.20

...