Web Server Example
See a Linux-based web server example using containers.
So far, we’ve seen how to start a simple container and interact with it. We’ve also seen how to stop, restart, and delete containers. Now let’s take a look at a Linux-based web server example.
In this example, we’ll start a new container from an image that runs a simple web server on port 8080.
Running the server
You can use the docker container stop
and docker container rm
commands to clean up any existing containers on your system. Then run the following command to start a new web server container.
Get hands-on with 1200+ tech skills courses.