Sign inSign up

openeuler/distroless-php

Sponsored OSS

By openeuler

•Updated about 1 month ago

Image
0

2.6K

openeuler/distroless-php repository overview

⁠Quick reference

⁠distroless-php | openEuler

This image contains a minimal Linux, php runtime.

PHP is a server-side scripting language designed for web development, but which can also be used as a general-purpose programming language. PHP can be added to straight HTML or it can be used with a variety of templating engines and web frameworks. PHP code is usually processed by an interpreter, which is either implemented as a native module on the web-server or as a common gateway interface (CGI).

The tag details are as follows

TagCurrentlyArchitectures
8.3.19-oe2403lts⁠PHP 8.3.19 on openEuler 24.03-LTSamd64, arm64

⁠Usage

Create a Dockerfile in your PHP project

# Dockerfile

FROM openeuler/distroless-php:8.3.19-oe2403lts
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
CMD [ "php", "./your-script.php" ]

Then, run the commands to build and run the Docker image:

$ docker build -t my-php-app .
$ docker run -it --rm --name my-running-app my-php-app

Run a single PHP script

For many simple, single file projects, you may find it inconvenient to write a complete Dockerfile. In such cases, you can run a PHP script by using the PHP Docker image directly, for example⁠:

$ docker run -it --rm -v $PWD/example:/usr/src/myapp -w /usr/src/myapp openeuler/distroless-php:8.3.19-oe2403lts php test.php

The result is

测试通过: 2 + 3 = 5
测试通过: -1 + (-1) = -2
测试通过: 整数溢出检测(捕获异常: add(): Return value must be of type int, float returned)

⁠Run Applications as a Non-Root User

For implementation details, refer to the distroless-base-nonroot documentation⁠.

⁠Question and answering

If you have any questions or want to use some special features, please submit an issue or a pull request on openeuler-docker-images⁠.

Tag summary

Content type

Image

Digest

sha256:a6d221cc6…

Size

16.9 MB

Last updated

about 1 month ago

docker pull openeuler/distroless-php:8.3.19-oe2403lts

This week's pulls

Pulls:

33

Sep 14 to Sep 20