You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# When a GitHub release event occurs, build both the development and production images contained within the `Dockerfile` using the `build-image.yaml` reusable workflow. Both images will then be published to GitHub Container Registry so they can be used as part of Bluewing application images.
2
+
# This workflow run can take up to 20 minutes or more because the PHP extensions needed must be built from source.
This repository contains a general-purpose base PHP docker image for use in Bluewing applications that combines the lightweight base image of Alpine Linux with the speed-wins normally gained through using Debian.
4
+
5
+
## Rationale
6
+
7
+
Alpine Linux PHP docker images are typically 6× smaller in size or more, which makes them an excellent choice due to their lightweight footprint. They do however come with the disadvantage that [they ship with musl libc instead of glib and friends](https://hub.docker.com/_/php). This means that the PHP extensions we need as part of our application stack must be compiled from source, installed of installed from a precompiled binary, which significantly slows the build time—up to 800 seconds or more to build a base image with the dependencies we need.
8
+
9
+
We have extracted these long build times to an infrequently-modified Docker image that can be built once in CI and pulled as much as necessary.
10
+
11
+
## Available tags
12
+
13
+
Two image variants are available, a primary image that requires in `pdo_pgsql` and `phpredis` so we can use a development image tagged `dev` which additionally includes `xdebug`.
14
+
15
+
| Tag | PHP version | Alpine Version | Extensions | Build size |
Each flavour of image is tagged three times, making it possible to select images based purely on the latest version, the latest version of a specific PHP release, or a specific image entirely:
21
+
22
+
*`FLAVOR-latest`
23
+
*`FLAVOR-PHP_VERSION-latest`
24
+
*`FLAVOR-PHP_VERSION-DATE`
25
+
26
+
PHP extensions are installed using the [thecodingmachine/docker-images-php](https://github.com/thecodingmachine/docker-images-php) Docker image.
27
+
28
+
## Building
29
+
30
+
Each image is built when a release occurs, using GitHub Actions, and published to GitHub Container Registry. To use these images in your `Dockerfile`, reference them as follows:
31
+
32
+
```Dockerfile
33
+
# Development, includes xdebug along with other extensions.
34
+
FROM ghcr.io/bluewing/php-docker-image:dev-latest
35
+
# Production, only pdo_pgsql and redis
36
+
FROM ghcr.io/bluewing/php-docker-image:main-latest
0 commit comments