Sign inSign up

vadymsemeniuk/docker-php

By vadymsemeniuk

Updated 4 months ago

Automated build for docker-php image

Image
Developer tools
30

1M+

vadymsemeniuk/docker-php repository overview

PHP Docker Images

This repository provides Docker images for multiple PHP versions, configured for development and testing environments. Each image includes support for various PHP extensions and tools.


Available Tags

TagPHP VersionBase OS
7.1PHP 7.1Debian Buster
7.2PHP 7.2Debian Buster
7.3PHP 7.3Debian Buster
7.4PHP 7.4Debian Buster
8.0PHP 8.0Debian Bullseye
8.1PHP 8.1Debian Bullseye
8.2PHP 8.2Debian Bullseye
8.3PHP 8.3Debian Bookworm
8.4PHP 8.4Debian Bookworm
8.5, latestPHP 8.5Debian Bookworm

Features

  • Multiple PHP versions: 7.1 through 8.5, each as a separate image tag.
  • FPM-based: All images use php-fpm as the process manager.
  • Multi-arch: Images are built for linux/amd64 and linux/arm64.
  • Configurable build: Optional extensions enabled via build arguments.
  • Included by default: PDO (MySQL, PostgreSQL), GD.

Getting Started

Pull an Image
docker pull vadymsemeniuk/docker-php:8.4
docker pull vadymsemeniuk/docker-php:7.4
Build Locally
docker build -f DockerFile-84 -t vadymsemeniuk/docker-php:8.4 .
Build Arguments

Customize the image using the following optional build arguments:

ArgumentDescriptionDefault
INSTALL_SOAPEnable SOAP extensionfalse
INSTALL_XDEBUGEnable xDebug extensionfalse
INSTALL_PHPREDISEnable Redis extensionfalse
INSTALL_BCMATHEnable BCMath extensionfalse
INSTALL_MEMCACHEDEnable Memcached extensionfalse
INSTALL_OPCACHEEnable Opcache extensionfalse
INSTALL_MYSQLIEnable MySQLi extensionfalse
INSTALL_INTLEnable Intl extensionfalse

Note: INSTALL_AEROSPIKE is only available in the 7.1 image. The Aerospike PHP client does not support PHP 7.2+.

Example:

docker build -f DockerFile-84 \
  --build-arg INSTALL_XDEBUG=true \
  --build-arg INSTALL_OPCACHE=true \
  -t vadymsemeniuk/docker-php:8.4 .

Run the Container
docker run -d -p 9000:9000 -v $(pwd):/var/www vadymsemeniuk/docker-php:8.4

Build & Push All Tags

Use the provided script to build and push all versions with multi-arch support:

./build-and-push.sh

This builds all tags for linux/amd64 and linux/arm64 and pushes them to Docker Hub.


Configuration Files

The following configuration files are included and mounted into the container:

  • PHP Configuration: configs/php.ini
  • PHP-FPM Pool Configuration: configs/php-fpm.pool.conf
  • xDebug Configuration: configs/xdebug.ini
  • Opcache Configuration: configs/opcache.ini

Extensions

Included by Default
  • GD: Image manipulation (JPEG, FreeType).
  • PDO: Database support for MySQL and PostgreSQL.
Optional (via Build Arguments)
  • SOAP: SOAP-based web services.
  • xDebug: Debugging and profiling.
  • Redis: Redis integration.
  • BCMath: Arbitrary precision mathematics.
  • Memcached: Caching layer.
  • Opcache: PHP opcode caching.
  • MySQLi: Extended MySQL support.
  • Intl: Internationalization support.

Exposed Ports

  • 9000: Default PHP-FPM port.

License

This Docker image is licensed under the MIT License.


For issues or contributions, feel free to open an issue or submit a pull request.

Tag summary

Content type

Image

Digest

sha256:db4b65d70

Size

176.4 MB

Last updated

4 months ago

docker pull vadymsemeniuk/docker-php