DEV Community

Sidgley de Almeida Guedes
Sidgley de Almeida Guedes

Posted on

How to create a temporary PHP container for test

Requeriments

  • Must have docker installed.

You can use the following tutorial to install docker

How to install docker on Ubuntu

Open terminal and type de following code

docker run --rm -it php:8.1 /bin/bash

Or, if you would like to move files into the container use:

docker run --rm -it -v /origin_path_name/file_name.extension:/destination_path_name/file_name.extension php:8.1 /bin/bash

After that, you can find your file and execute it by typing:

php file_name

Top comments (0)