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
6 changes: 3 additions & 3 deletions .github/workflows/docker-buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ["8.1", "8.2", "8.3", "8.4"]
php_version: ["8.1", "8.2", "8.3", "8.4", "8.5"]
variant: ["apache-trixie", "apache-bookworm", "fpm-alpine"]
steps:
- name: Checkout
Expand All @@ -40,7 +40,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: github.event_name != 'pull_request'
- name: Set Dockerfile directory
if: ${{ matrix.php_version == '8.1' || matrix.php_version == '8.2' || matrix.php_version == '8.3' || matrix.php_version == '8.4' }}
if: ${{ matrix.php_version == '8.1' || matrix.php_version == '8.2' || matrix.php_version == '8.3' || matrix.php_version == '8.4' || matrix.php_version == '8.5' }}
run: echo "DOCKERFILE_DIR=php8" >> $GITHUB_ENV
- name: Generate Docker tags
id: tags
Expand All @@ -59,7 +59,7 @@ jobs:
fi

# For the latest PHP version on apache-trixie, add the latest tag
if [ "${{ matrix.php_version }}" = "8.4" ] && [ "${{ matrix.variant }}" = "apache-trixie" ]; then
if [ "${{ matrix.php_version }}" = "8.5" ] && [ "${{ matrix.variant }}" = "apache-trixie" ]; then
TAGS="${TAGS},hussainweb/drupal-base:latest"
fi

Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ This repository contains two main variants of the Drupal base image:

Choose the image that best fits your needs. The Apache image is a good choice for a simple, all-in-one container, while the FPM image is ideal for use with a separate web server like Nginx.

## Supported PHP Versions

This image supports the following PHP versions:

- PHP 8.1
- PHP 8.2
- PHP 8.3
- PHP 8.4
- PHP 8.5 (latest)

Each version is available in all variants (apache-bookworm, apache-trixie, fpm-alpine).

### Available Tags

- `php8.5`, `latest` - PHP 8.5 with Apache on Debian Trixie
- `php8.5-apache-trixie` - PHP 8.5 with Apache on Debian Trixie
- `php8.5-apache-bookworm` - PHP 8.5 with Apache on Debian Bookworm
- `php8.5-alpine`, `php8.5-fpm-alpine`, `latest-alpine` - PHP 8.5 FPM on Alpine Linux
- `php8.4`, `php8.3`, `php8.2`, `php8.1` - Older PHP versions with Apache on Debian Trixie
- `php8.4-alpine`, `php8.3-alpine`, `php8.2-alpine`, `php8.1-alpine` - Older PHP versions FPM on Alpine Linux

All images support both `linux/amd64` and `linux/arm64` architectures.

## Usage

### Apache
Expand All @@ -22,7 +45,7 @@ Here is an example `docker-compose.yml` snippet:
```yaml
services:
drupal:
image: hussainweb/drupal-base:php8.4
image: hussainweb/drupal-base:php8.5
volumes:
- ./path/to/your/drupal/root:/var/www/html
ports:
Expand All @@ -39,7 +62,7 @@ Here is an example `docker-compose.yml` snippet:
```yaml
services:
drupal:
image: hussainweb/drupal-base:php8.4-alpine
image: hussainweb/drupal-base:php8.5-alpine
volumes:
- ./path/to/your/drupal/root:/var/www/html
restart: always
Expand Down
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,25 @@ docker pull php:8.1-apache-bookworm
docker pull php:8.2-apache-bookworm
docker pull php:8.3-apache-bookworm
docker pull php:8.4-apache-bookworm
docker pull php:8.5-apache-bookworm
docker pull php:8.1-fpm-alpine
docker pull php:8.2-fpm-alpine
docker pull php:8.3-fpm-alpine
docker pull php:8.4-fpm-alpine
docker pull php:8.5-fpm-alpine
docker pull composer:2

docker buildx create --use --name drupal-base-builder

docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.1 --build-arg PHP_VERSION=8.1-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.2 --build-arg PHP_VERSION=8.2-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.3 --build-arg PHP_VERSION=8.3-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4 --tag hussainweb/drupal-base:latest --build-arg PHP_VERSION=8.4-apache-bookworm ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4 --build-arg PHP_VERSION=8.4-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5 --tag hussainweb/drupal-base:latest --build-arg PHP_VERSION=8.5-apache-bookworm ${dir}/php8/apache-bookworm/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.1-alpine --build-arg PHP_VERSION=8.1-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.2-alpine --build-arg PHP_VERSION=8.2-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.3-alpine --build-arg PHP_VERSION=8.3-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4-alpine --tag hussainweb/drupal-base:latest-alpine --build-arg PHP_VERSION=8.4-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.4-alpine --build-arg PHP_VERSION=8.4-fpm-alpine ${dir}/php8/fpm-alpine/
docker buildx build --push --platform linux/amd64,linux/arm64 --tag hussainweb/drupal-base:php8.5-alpine --tag hussainweb/drupal-base:latest-alpine --build-arg PHP_VERSION=8.5-fpm-alpine ${dir}/php8/fpm-alpine/

docker buildx rm drupal-base-builder
4 changes: 4 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ docker rmi php:8.1-apache-bullseye
docker rmi php:8.2-apache-bullseye
docker rmi php:8.3-apache-bullseye
docker rmi php:8.4-apache-bullseye
docker rmi php:8.5-apache-bullseye
docker rmi php:8.1-fpm-alpine
docker rmi php:8.2-fpm-alpine
docker rmi php:8.3-fpm-alpine
docker rmi php:8.4-fpm-alpine
docker rmi php:8.5-fpm-alpine
docker rmi composer:2

docker rmi hussainweb/drupal-base:php8.1
docker rmi hussainweb/drupal-base:php8.2
docker rmi hussainweb/drupal-base:php8.3
docker rmi hussainweb/drupal-base:php8.4
docker rmi hussainweb/drupal-base:php8.5
docker rmi hussainweb/drupal-base:php8.1-alpine
docker rmi hussainweb/drupal-base:php8.2-alpine
docker rmi hussainweb/drupal-base:php8.3-alpine
docker rmi hussainweb/drupal-base:php8.4-alpine
docker rmi hussainweb/drupal-base:php8.5-alpine
docker rmi hussainweb/drupal-base:latest
12 changes: 11 additions & 1 deletion php8/apache-bookworm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@ RUN set -eux; \
--with-webp \
; \
\
# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5" from "8.5-apache-bookworm")
PHP_MAJOR_MINOR=$(echo "${PHP_VERSION}" | cut -d'-' -f1); \
# Opcache is bundled in PHP 8.5+, so only install it for earlier versions
case "$PHP_MAJOR_MINOR" in \
8.[5-9]*|[9-9]*.*) \
OPCACHE_EXT="" ;; \
*) \
OPCACHE_EXT="opcache" ;; \
esac; \
\
docker-php-ext-install -j "$(nproc)" \
bcmath \
bz2 \
exif \
gd \
intl \
opcache \
$OPCACHE_EXT \
pcntl \
pdo_mysql \
pdo_pgsql \
Expand Down
12 changes: 11 additions & 1 deletion php8/apache-trixie/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@ RUN set -eux; \
--with-webp \
; \
\
# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5" from "8.5-apache-trixie")
PHP_MAJOR_MINOR=$(echo "${PHP_VERSION}" | cut -d'-' -f1); \
# Opcache is bundled in PHP 8.5+, so only install it for earlier versions
case "$PHP_MAJOR_MINOR" in \
8.[5-9]*|[9-9]*.*) \
OPCACHE_EXT="" ;; \
*) \
OPCACHE_EXT="opcache" ;; \
esac; \
\
docker-php-ext-install -j "$(nproc)" \
bcmath \
bz2 \
exif \
gd \
intl \
opcache \
$OPCACHE_EXT \
pcntl \
pdo_mysql \
pdo_pgsql \
Expand Down
12 changes: 11 additions & 1 deletion php8/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,23 @@ RUN set -eux; \
--with-webp \
; \
\
# Extract PHP major.minor version from PHP_VERSION (e.g., "8.5" from "8.5-fpm-alpine")
PHP_MAJOR_MINOR=$(echo "${PHP_VERSION}" | cut -d'-' -f1); \
# Opcache is bundled in PHP 8.5+, so only install it for earlier versions
case "$PHP_MAJOR_MINOR" in \
8.[5-9]*|[9-9]*.*) \
OPCACHE_EXT="" ;; \
*) \
OPCACHE_EXT="opcache" ;; \
esac; \
\
docker-php-ext-install -j "$(nproc)" \
bcmath \
bz2 \
exif \
gd \
intl \
opcache \
$OPCACHE_EXT \
pcntl \
pdo_mysql \
pdo_pgsql \
Expand Down