Skip to content

Commit b79d4f8

Browse files
authored
Merge pull request #25 from dokuwiki/custom-extensions
allow compiling additional PHP extensions by build arg
2 parents 52a48fd + 282d0b9 commit b79d4f8

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM php:8.2-apache AS dokuwiki-base
22

3+
# additional extensions can be passed as build-arg
4+
ARG PHP_EXTENSIONS=""
5+
36
COPY root/build-deps.sh /
47
RUN /bin/bash /build-deps.sh
58

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,9 @@ To manually build the image:
8989

9090
docker build --build-arg="DOKUWIKI_VERSION=stable" -t dokuwiki/dokuwiki:stable .
9191

92-
Builds and deployments are currently done daily using
93-
the [GitHub Actions workflow](https://github.com/dokuwiki/docker/actions/workflows/docker.yml).
92+
Additional PHP extensions can be added to the image using the `PHP_EXTENSIONS` build argument. The value should be a space separated list of PHP extension names as understood by [docker-php-extension-installer](https://github.com/mlocati/docker-php-extension-installer). For example:
93+
94+
docker build --build-arg="PHP_EXTENSIONS=pdo_pgsql pdo_mysql" -t dokuwiki/dokuwiki:stable .
95+
96+
Builds are currently done daily using
97+
the [GitHub Actions workflow](https://github.com/dokuwiki/docker/actions/workflows/docker.yml) and new images are pushed for all upstream changes.

root/build-deps.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ apt-get autoclean
1818
curl -sSLf -o install-php-extensions \
1919
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
2020
chmod +x install-php-extensions
21-
./install-php-extensions gd bz2 opcache pdo_sqlite intl ldap
21+
./install-php-extensions gd bz2 opcache pdo_sqlite intl ldap $PHP_EXTENSIONS
2222
rm install-php-extensions
23+
php -m
2324

2425
# remove package cache
2526
apt-get clean

0 commit comments

Comments
 (0)