A complete, lightweight, and versatile PHP Docker image collection based on Alpine Linux. These images are designed to be small, efficient, and ready to use in various environments.
- Lightweight: Based on Alpine Linux, with optimized image sizes (~135-154MB)
- Multi-architecture support: Runs on amd64 (x86_64) and arm64 (Raspberry PI, Graviton)
- Multiple PHP versions: From PHP 5.6 to the latest PHP 8.4
- Variety of configurations: Base, CLI, FPM, FPM-Nginx, and FPM-Apache variants
- Pre-installed extensions: 45+ PHP extensions included in all images
- Development tools: Composer, PHPUnit, PHP Code Sniffer, and more in CLI images
- Production-ready: Optimized for both development and production environments
- Base Image - Minimal image with 45+ extensions
- CLI Image - Command-line tools for development
- FPM Images - PHP-FPM, Nginx, and Apache variants
- Environment Variables - Configuration options
- Building Custom Images - Create your own images
- IDE Integration - Using with your IDE
- Dockerfile Reference - Dockerfile details
- Tagging Convention - Understanding image tags
See full documentation at: https://opensource.byjg.com/devops/docker-php
A complete and small PHP Docker image based on Alpine Linux and run on the archictectures
- amd64 (x86_64)
- arm64 (Raspberry PI, Graviton, etc) - available after February 2021
The Docker ByJG PHP Images has several bundled images based on PHP in different versions.
The PHP images are ready to use in:
- Development Environment
- Production Environment
- CI/CD environments (like Travis-CI, Circle-CI, Jenkis, Bitbucket Pipelines, and others)
- IDE Integration
Version | Latest Version | Monthly Builds | Alpine Version |
---|---|---|---|
8.4 | 8.4.5 | yes | edge |
8.3 | 8.3.18 | yes | edge |
8.2 | 8.2.28 | yes | edge |
8.1 | 8.1.31 | - | 3.19 |
8.0 | 8.0.30 | - | 3.16 |
7.4 | 7.4.33 | - | 3.15 |
7.3 | 7.3.33 | - | 3.12 |
7.2 | 7.2.33 | - | 3.9 |
7.1 | 7.1.33 | - | 3.7 |
7.0 | 7.0.33 | - | 3.5 |
5.6 | 5.6.40 | - | 3.8 |
Notes:
- PHP Images with no monthly builds are not updated anymore and there is no support.
- PHP images using the edge base image are suitable for production. However, they may receive package updates. If you extend these images by adding more packages, those packages may not be available in future updates.
Five different images for each PHP Version
- base - Minimal Image, base for the other
- cli - PHP with Command Line installed (composer, phpunit, etc)
- fpm - PHP with FPM installed
- fpm-apache - PHP and Apache using FPM
- fpm-nginx - PHP and Nginx using FPM
Since January 2021 de tag convention is:
byjg/php:<PHP_VERSION>-<TYPE>[-YYYY.MM]
Where:
- PHP_VERSION: It is
<MAJOR>.<MINOR>
, e.g8.2
- TYPE: It is
base
,cli
,fpm
,fpn-nginx
,fpm-apache
- YYYY: The Year of the Build
- MM: The month of the build.
The images without YYYY-MM can be updated to the latest PHP version and new features. The images with YYYY-MM are immutable
e.g.
byjg/php:8.3-fpm
byjg/php:8.3-fpm-2024.10
Here a list of environment variables.
Below a table with images uncompressed
Build Type | Uncompressed Size |
---|---|
base | ~135MB |
cli | ~154MB |
fpm | ~139MB |
fpm-nginx | ~154MB |
fpm-apache | ~154MB |
Detailed instructions can be found here.