KEINOS / Dockerfile_of_PHP8-JIT

✅ Dockerfile of PHP8.0 with JIT Enabled in Alpine Image.
https://arkadiuszkondas.com/how-to-run-php-8-with-jit-support-using-docker/
9 stars 4 forks source link

Can't run image on RaspberryPi3 (Jessie) #2

Closed KEINOS closed 5 years ago

KEINOS commented 5 years ago

I get a standard_init_linux.go:190: exec user process caused "exec format error" error on Raspbian OS.

$ docker pull keinos/php8-jit
...
Digest: sha256:f98e09c9ec2d125b15660c9e1ebef96557217a6ee45641274f1fbb198c9d34f2
Status: Downloaded newer image for keinos/php8-jit:latest
$ docker run --rm keinos/php8-jit:latest --version
standard_init_linux.go:190: exec user process caused "exec format error"
Env Info
```shellsession $ cat /sys/firmware/devicetree/base/model Raspberry Pi 3 Model B Rev 1.2 $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" $ docker version Client: Version: 18.06.3-ce API version: 1.38 Go version: go1.10.3 Git commit: d7080c1 Built: Wed Feb 20 02:48:01 2019 OS/Arch: linux/arm Experimental: false Server: Engine: Version: 18.06.3-ce API version: 1.38 (minimum version 1.12) Go version: go1.10.3 Git commit: d7080c1 Built: Wed Feb 20 02:43:39 2019 OS/Arch: linux/arm Experimental: false ```
KEINOS commented 5 years ago

I get a standard_init_linux.go:190: exec user process caused "exec format error" error on Raspbian OS.

The main reason for this error is a mismatch of the CPU architecture.

The "automated build" image, which has the "latest" tag, was built on x86_68 CPU architecture. But RaspberryPi runs on ARM CPU architecture. So basically you need to re-build the image locally.

The automated build feature on the official Docker Hub only runs the normal x86_64 docker implementation. Since arm code is not something an x86_64 CPU can execute, that’s why you get the ‘exec format failure’ on the automated build system.

(From the comment on "Automated Build Raspberry Pi based image on Docker Hub" @ Docker Forum )

I will push the built image on ARM to Docker Hub but meanwhile build it your own by:

  1. Clone the repo to local and move into the cloned directory.
  2. Build the docker image. (It will take time)
$ # Move to any working directory you want
$ cd /path/to/your/working/directory
$ # Clone the repo with any dir name (ex: my-php8-jit)
$ git clone https://github.com/KEINOS/Dockerfile-of-PHP8-JIT.git my-php8-jit
$ # Move into the clone repo
$ cd $_
$ # Build the image with any image name (ex: php8-jit:local)
$ docker build --no-cache -t php8-jit:local .
...
Successfully built xxxxxxxxxxxxxx
Successfully tagged php8-jit:local
$ # Sample run
$ docker run --rm -it php8-jit:arm --version
PHP 8.0.0-dev (cli) (built: Jul 20 2019 01:01:42) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0-dev, Copyright (c), by Zend Technologies
KEINOS commented 5 years ago

Now, an image for RaspberryPi (ARM architecture) is available to pull.

Specify arm tag while pulling the image.

docker pull keinos/php8-jit:arm