PHP 8.4/8.5 with the V8Js extension (Google V8 JavaScript engine) — Debian & Alpine, amd64+arm64.
10K+
PHP 8.4 and 8.5 images with the phpv8/v8js extension (Google's V8 JavaScript engine embedded in PHP) and Composer 2, built on the official php images.
linux/amd64 + linux/arm64 (incl. Apple Silicon via Docker Desktop)cli, fpm, apache, and thread-safe ztstrixie and Alpinenew V8Js(), script execution, JS↔PHP marshalling, exception propagation), so a broken extension fails the build, not your deploySource, Dockerfiles and build docs: https://github.com/marekskopal/php-v8js-docker
| PHP | Variant | OS | Tags |
|---|---|---|---|
| 8.5 | cli | trixie | 8.5-cli-trixie, 8.5-cli, 8.5, latest |
| 8.5 | fpm | trixie | 8.5-fpm-trixie, 8.5-fpm |
| 8.5 | apache | trixie | 8.5-apache-trixie, 8.5-apache |
| 8.5 | zts | trixie | 8.5-zts-trixie, 8.5-zts |
| 8.5 | cli | alpine | 8.5-cli-alpine |
| 8.5 | fpm | alpine | 8.5-fpm-alpine |
| 8.5 | zts | alpine | 8.5-zts-alpine |
| 8.4 | cli | trixie | 8.4-cli-trixie, 8.4-cli, 8.4 |
| 8.4 | fpm | trixie | 8.4-fpm-trixie, 8.4-fpm |
| 8.4 | apache | trixie | 8.4-apache-trixie, 8.4-apache |
| 8.4 | zts | trixie | 8.4-zts-trixie, 8.4-zts |
| 8.4 | cli | alpine | 8.4-cli-alpine |
| 8.4 | fpm | alpine | 8.4-fpm-alpine |
| 8.4 | zts | alpine | 8.4-zts-alpine |
Tag shorthands follow the official php image convention: bare <php> and <php>-<variant> point to the Debian/trixie variant. There is no apache-alpine variant, because the upstream php image doesn't provide one.
docker pull marekskopal/php-v8js:latest
docker run --rm marekskopal/php-v8js:latest \
php -r 'echo (new V8Js)->executeString("1+2"), PHP_EOL;'
PHP-FPM (Docker Compose)
services:
php:
image: marekskopal/php-v8js:8.5-fpm
volumes:
- ./app:/var/www/html
Apache
docker run --rm -p 8080:80 -v "$PWD/app":/var/www/html \
marekskopal/php-v8js:8.5-apache
As a base image
FROM marekskopal/php-v8js:8.5-fpm
COPY . /var/www/html
RUN composer install --no-dev --optimize-autoloader
| OS | V8 source | Version |
|---|---|---|
| Debian | Built from source with Debian clang | 13.9.210 (pinned) |
| Alpine | Linked against Alpine's nodejs-dev (same approach as v8js's own CI) | V8 shipped with Alpine 3.22's Node.js, currently 13.6.233.17 (Node 24) |
The V8 version an image was built against is recorded in /etc/v8.version and in the v8.version image label. At runtime:
docker run --rm marekskopal/php-v8js:latest php -r 'echo V8Js::V8_VERSION, PHP_EOL;'
V8 14.x isn't supported yet because v8js doesn't build against it (phpv8/v8js#546). 13.9.210 is the newest V8 13 release.
zts (thread-safe) variant: FrankenPHPThe cli/fpm/apache images are non-thread-safe (NTS), like the upstream php defaults. The zts images ship a thread-safe v8js.so for ZTS PHP builds, most notably FrankenPHP. An NTS extension cannot load into a ZTS PHP.
The Alpine zts image is meant for copying the extension into a FrankenPHP Alpine image:
FROM marekskopal/php-v8js:8.5-zts-alpine AS v8js
FROM dunglas/frankenphp:1-php8.5-alpine
RUN apk add --no-cache nodejs-libs
COPY --from=v8js /usr/local/lib/php/extensions/no-debug-zts-20250925/v8js.so \
/usr/local/lib/php/extensions/no-debug-zts-20250925/v8js.so
COPY --from=v8js /usr/local/etc/php/conf.d/v8js.ini \
/usr/local/etc/php/conf.d/v8js.ini
The extension directory suffix (no-debug-zts-20250925) is the PHP 8.5 module API stamp. It's the same across all 8.5.x patch releases, so it matches any FrankenPHP php8.5 Alpine tag.
Temporal API. V8's Temporal implementation requires Rust, and there's no Linux arm64 Rust toolchain for V8, so it's disabled. Upstream gates it behind --harmony-temporal anyway./etc/v8.version.Images are built with docker buildx bake. You can override the V8 version, for example:
docker buildx bake --set "*.args.V8_VERSION=13.8.260"
Building V8 from source takes 1–2 hours per architecture on the first build. See the GitHub repository for build details, toolchain notes and CI setup.
MIT
Content type
Image
Digest
sha256:dc78e93f8…
Size
204.4 MB
Last updated
2 days ago
docker pull marekskopal/php-v8js