A simple PHP application demonstrating an HTTP server that responds with "hello world."
Docker must be installed. You can install Docker from docker.com
First, pull the image from Docker Hub using the following command:
docker pull estebanandres/hellophp
To run the container, use the following command:
docker run -p 8081:80 estebanandres/hellophp
-p 8081:80 maps port 80 from the container to port 8081 on your machine.To use the previous command, port 8081 must be available. If it's in use, you can map it to another port. For example, to map to port 3000, use the following command:
docker run -p 3000:80 estebanandres/hellophp
If you want to run the container in the background, use the -d flag for detached mode:
docker run -d -p 8081:80 --name hellophp estebanandres/hellophp
The -d flag runs the container in the background, allowing you to continue using your terminal while the container runs.
You can verify that the container is running in the background by using:
docker ps
This command will show you a list of all running containers.
docker pull estebanandres/hellophp
docker run -d -p 8081:80 --name hellophp estebanandres/hellophp
Once the container is running, access the application in your browser at:
http://localhost:8081
To stop the container:
docker stop estebanandres/hellophp
To restart a stopped container:
docker start estebanandres/hellophp
To remove the container after stopping it:
docker rm estebanandres/hellophp
Content type
Image
Digest
sha256:03e8687dd…
Size
155.7 MB
Last updated
almost 2 years ago
docker pull estebanandres/hellophp