Skip to content
Dockerfile of PHP8.0 with JIT Enabled. (Unofficial)
PHP Shell Dockerfile
Branch: php8-jit
Clone or download
This branch is 29 commits ahead, 4 commits behind akondas:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
php.ini
scripts
test
.dockleignore
Dockerfile
README.md
docker-compose.test.yml
info-get_loaded_extensions.txt
info-phpinfo.txt
run-benchmark.sh

README.md

PHP8.0 with JIT Enabled on Docker

This is a PHP-8-ish(latest master branch of PHP) with JIT feature enabled on Docker.

  • x86_64/ARMv7/ARMv6 architecture available.

    # x86_64(Intel/AMD) and ARMv7 CPU Architecture (For most users)
    docker pull keinos/php8-jit:latest
    # ARMv6 CPU Architecture (For RaspberryPi Zero Users)
    docker pull keinos/php8-jit:arm32v6
  • This image is based on:

  • Image Info

  • Settings to be noted:

    • Default user: www-data
    • JIT/OPcache/Sodium: enabled
    • mbstring: enabled
      • multibyte = On
      • Encoding = UTF-8 (Both script and internal)
      • language = Japanese
    • GD: enabled
    • phpinfo()
    • Loaded Extensions]('info-get_loaded_extensions.txt')

Usage

$ # Pull image (If ARMv6 architecture then specify tag as keinos/php8-jit:arm32v6)
$ docker pull keinos/php8-jit:latest
...
$ # Run interactively
$ docker run --rm -it keinos/php8-jit:latest
Interactive shell

php > echo phpversion();
8.0.0-dev
php > exit
$
$ # Mount local file and run
$ ls
test.php
$ # Run script
$ docker run --rm \
>   -v $(pwd)/test.php:/app/test.php \
>   -w /app \
>   keinos/php8-jit \
>   php test.php
...

Perfomance Comparison

  • Test Code

  • Result

    - Run test with PHP7 (Local run on macOS)
    PHP Version:7.1.23
    Fibonacci(32): 3524578
    Time: 0.31194710731506
    
    - Run test with PHP7 (Docker: php:7.3.6-alpine)
    PHP Version:7.3.6
    Fibonacci(32): 3524578
    Time: 0.23761606216431
    
    - Run test with PHP8 JIT Disabled (Docker: akondas/php:8.0-cli-alpine)
    PHP Version:8.0.0-dev
    Fibonacci(32): 3524578
    Time: 0.24200105667114
    
    - Run test with PHP8 JIT Enabled (Docker: keinos/php8-jit:8.0.0-dev)
    PHP Version:8.0.0-dev
    Fibonacci(32): 3524578
    Time: 0.10379791259766
  • Tested Env

    $ # macOS Mojave (OSX 10.14.5)
    $ sw_vers
    ProductName:	Mac OS X
    ProductVersion:	10.14.5
    BuildVersion:	18F132
    
    $ docker version
    Client: Docker Engine - Community
    Version:           18.09.2
    API version:       1.39
    Go version:        go1.10.8
    Git commit:        6247962
    Built:             Sun Feb 10 04:12:39 2019
    OS/Arch:           darwin/amd64
    Experimental:      false
    
    Server: Docker Engine - Community
    Engine:
    Version:          18.09.2
    API version:      1.39 (minimum version 1.12)
    Go version:       go1.10.6
    Git commit:       6247962
    Built:            Sun Feb 10 04:13:06 2019
    OS/Arch:          linux/amd64
    Experimental:     false
You can’t perform that action at this time.