国人编译 php7.3 GD Redis MongoDB XDebug opcache fpm
1.6K
FROM cnbbx/php7-fpm
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
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:
$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp cnbbx/php7-fpm php your-script.php
Content type
Image
Digest
Size
43 MB
Last updated
almost 5 years ago
docker pull cnbbx/php7-fpm