While designed for web development, the PHP scripting language also provides general-purpose use.
10K+
The PHP image for containerised applications.
This package is used to build the PHP Docker images primarily used by the Immediate Media micro-services.
For more information, visit the documentation of the Official PHP Docker Image hosted on Docker Hub.
Create a Dockerfile in your PHP project
FROM immediate/php:<version>-fpm
WORKDIR /var/www/html
COPY . .
CMD [ "php", "./<script-name>.php" ]
The PHP image comes with a number of tags, each designed for a specific use case.
Supported versions:
versions.txt filephp:<version>-fpmThis variant contains PHP-FPM, and requires some kind of reverse proxy such as NGINX, Apache, or other tool which speaks the FastCGI protocol.
The following additional extensions are installed by default:
gmp
intl
opcache
pcntl
pdo_mysql
zip
php:<version>-fpm-mongodbThis variant is the same as above, but comes with additional mongodb support.
This repository comes with a build.sh script which will build all available variants, and push.sh which will push them.
Variants based on a single PHP version can also be built by running docker-compose directly.
To build variants for a single PHP version, run the following commands:
$ export PHP_VERSION=<version>
$ docker-compose build --pull --parallel
Content type
Image
Digest
Size
42.3 MB
Last updated
almost 7 years ago
docker pull immediate/php