I want to run a php script as a oneliner from the command line. Since on this linux machine no PHP is installed but Docker I thought about executing the PHP interpreter by running an little PHP Docker image which executing the script and deletes the container and image after finishing.
My internet connection is not fast and thus the image should be as small as possible.
The script process.php
should read the File data.json
in the current working directory and generate some text files in subdirectories. So no special PHP modules are required.
My questions:
- Which small/minimal ready-to-use-image on Dockerhub is recommended?
- How small is this image?
- How to write the one liner
docker run ...
to be executed on the Linux command line (bash
)?
My research on Dockerhub resulted in tons of PHP images with full blown PHP and not optimized on Host volume modifications as a one liner.