marekskopal/php-v8js

By marekskopal

Updated about 1 month ago

PHP 8.4/8.5 with the V8Js extension (Google V8 JavaScript engine) — Debian & Alpine, amd64+arm64.

Image
Languages & frameworks
0

2.0K

marekskopal/php-v8js repository overview

php-v8js

Production-grade Docker images for PHP 8.4 and PHP 8.5 with the phpv8/v8js extension preinstalled — letting PHP execute JavaScript via Google's V8 engine. Composer 2 included. All tags are multi-arch (linux/amd64 + linux/arm64, so they run natively on Apple Silicon Macs via Docker Desktop).

Source / Dockerfiles: https://github.com/marekskopal/php-v8js-docker

Tags

PHPVariantOSTag
8.5cliDebian bookwormlatest, 8.5, 8.5-cli, 8.5-cli-bookworm
8.5fpmDebian bookworm8.5-fpm, 8.5-fpm-bookworm
8.5apacheDebian bookworm8.5-apache, 8.5-apache-bookworm
8.5cliAlpine8.5-cli-alpine
8.5fpmAlpine8.5-fpm-alpine
8.4cliDebian bookworm8.4, 8.4-cli, 8.4-cli-bookworm
8.4fpmDebian bookworm8.4-fpm, 8.4-fpm-bookworm
8.4apacheDebian bookworm8.4-apache, 8.4-apache-bookworm
8.4cliAlpine8.4-cli-alpine
8.4fpmAlpine8.4-fpm-alpine

Tag shorthands follow the official php convention: 8.5 == 8.5-cli-bookworm, 8.5-fpm == 8.5-fpm-bookworm.

Quick start

# CLI: run a JS snippet from PHP
docker run --rm marekskopal/php-v8js:latest \
  php -r 'echo (new V8Js)->executeString("[1,2,3].map(x=>x*x).reduce((a,b)=>a+b)"), PHP_EOL;'

FPM behind nginx (Compose)

services: php: image: marekskopal/php-v8js:8.5-fpm volumes: - ./app:/var/www/html

# Apache with mod_php
docker run --rm -p 8080:80 \
  -v "$PWD/app":/var/www/html \
  marekskopal/php-v8js:8.5-apache

V8 version

  • Debian: V8 12.9.203 built from source via depot_tools. This is the highest version phpv8/v8js's CI actively tests against.
  • Alpine: V8 from Alpine's nodejs-libs package (currently V8 13.6.x via Node.js 24). Building V8 on musl from source is impractical; upstream v8js does the same thing.

The exact V8 version a running image was linked against is exposed at V8Js::V8_VERSION from PHP and as the v8.version / v8.source image labels.

What's inside

  • Official php:-- base
  • v8js.so loaded via /usr/local/etc/php/conf.d/v8js.ini
  • V8 shared libraries (Debian: /opt/v8/lib; Alpine: from nodejs-libs)
  • Composer 2 at /usr/local/bin/composer

Issues / contributions

https://github.com/marekskopal/php-v8js-docker/issues

Licensed MIT.

Tag summary

Content type

Image

Digest

sha256:98dd70fd7

Size

206.6 MB

Last updated

about 1 month ago

docker pull marekskopal/php-v8js:8.5-zts