611
A collection of optimized PHP Docker images based on Alpine Linux, including FPM, CLI, and ZTS variants for PHP versions 8.2, 8.3, 8.4, and 8.5.
Images are available on Docker Hub: kalidyasin/php
gd (with FreeType, JPEG, and WebP support)pdo, pdo_mysql, pdo_pgsqlzip, mbstring, exif, pcntl, bcmath, calendarredis (via PECL)fpm, cli, and zts.Images follow the naming convention: kalidyasin/php:<version>-<variant>-alpine
| PHP Version | Alpine | Variants | Docker Hub Tag Examples |
|---|---|---|---|
| 8.5 | Yes | fpm, cli, zts | 8.5-fpm-alpine, 8.5-cli-alpine |
| 8.4 | Yes | fpm, cli, zts | 8.4-fpm-alpine, 8.4-cli-alpine |
| 8.3 | Yes | fpm, cli, zts | 8.3-fpm-alpine, 8.3-cli-alpine |
| 8.2 | Yes | fpm, cli, zts | 8.2-fpm-alpine, 8.2-cli-alpine |
docker pull kalidyasin/php:8.5-fpm-alpine
docker run -it --rm -v $(pwd):/var/www/html kalidyasin/php:8.5-fpm-alpine
Create a docker-compose.yml file:
services:
app:
image: kalidyasin/php:8.5-fpm-alpine
volumes:
- .:/var/www/html
ports:
- "9000:9000"
Run with:
docker compose up -d
podman run -it --rm -v $(pwd):/var/www/html:Z kalidyasin/php:8.5-fpm-alpine
Note: The :Z flag is often needed on systems with SELinux (like Fedora/RHEL) to handle volume permissions.
Using the same docker-compose.yml as above:
podman-compose up -d
If you want to build the images locally or customize them:
docker build -t my-php-app:8.5-fpm ./8.5/alpine/fpm
podman build -t my-php-app:8.5-fpm ./8.5/alpine/fpm
The source code for these images is available on GitHub. To customize and build your own version:
git clone https://github.com/kalidyasin/docker-php.git
cd docker-php/8.5/alpine/fpm
docker build -t my-custom-php .
Content type
Image
Digest
sha256:8add9e0c0…
Size
42.6 MB
Last updated
3 months ago
docker pull kalidyasin/php:8.2-fpm-alpine