Installation
php-ci is distributed exclusively as a Docker image — there is nothing to compile or install on the host beyond Docker itself. This page covers pulling the image, choosing a variant and pinning it for reproducible builds.
Prerequisites
- Docker Engine 20.10+ (or any CI runner that can pull from Docker Hub).
- Network access to
hub.docker.com.
Pull the image
# Default — tracks the current stable PHP line
docker pull himanshuramavat/php-ci:latest
# Pick a PHP minor version explicitly
docker pull himanshuramavat/php-ci:8.1
docker pull himanshuramavat/php-ci:8.2
docker pull himanshuramavat/php-ci:8.3
docker pull himanshuramavat/php-ci:8.4
Choosing a variant
| Variant | Example tag | Use it for |
|---|---|---|
| Base | himanshuramavat/php-ci:8.3 | Generic PHP, Laravel, libraries |
| Rolling latest | himanshuramavat/php-ci:latest | Quick local experiments |
The base image covers the vast majority of projects, including TYPO3 extension
CI (functional tests can run against SQLite via pdo_sqlite). See the full tag
strategy in Docker Tags.
Use a precise version tag (e.g. :8.3) in pipelines, never :latest. It keeps
builds reproducible and prevents a new PHP minor from silently changing your test
results.
Pin to an immutable digest
For maximum reproducibility — compliance audits, reproducible release builds — reference the image by its content digest instead of a mutable tag:
# Resolve the current digest for a tag
docker pull himanshuramavat/php-ci:8.3
docker inspect --format='{{index .RepoDigests 0}}' himanshuramavat/php-ci:8.3
# Then reference it explicitly
docker pull himanshuramavat/php-ci@sha256:<digest>
A digest is immutable: the same sha256 always resolves to the exact same bytes,
even after the :8.3 tag is rebuilt with security patches.
Verify the install
docker run --rm himanshuramavat/php-ci:8.3 php --version
docker run --rm himanshuramavat/php-ci:8.3 composer --version
docker run --rm himanshuramavat/php-ci:8.3 php -m # list loaded extensions
Use as a base image
You can extend php-ci in your own Dockerfile when a project needs an extra
extension or tool:
FROM himanshuramavat/php-ci:8.3
# Example: add an extra system dependency and a global Composer tool
RUN apt-get update \
&& apt-get install -y --no-install-recommends libsodium-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install sodium
RUN composer global require friendsofphp/php-cs-fixer
Keeping up to date
Image tags are rebuilt periodically to absorb upstream PHP and OS security patches. Refresh your local copy with:
docker pull himanshuramavat/php-ci:8.3
In CI, runners pull a fresh copy on each job by default, so you automatically pick up rebuilt tags. Subscribe to the blog for release announcements.