NGINX web server via Docker
This recipe will step you through the basics of setting up a simple NGINX container via Docker. When you see the simplicity of the installation, don't be fooled by how easy it is, as that's the point of Docker.
Getting ready
If you're already running existing Docker containers, make sure they're either stopped or are not running on port 80. Otherwise, they will conflict with this recipe.
How to do it...
We'll start by pulling down the latest image of Docker. While this is an optional step, it will allow you to see how Docker works in stages for the first time. To download the NGINX image (which for the officially packaged version is simply called nginx
), run the following:
docker pull nginx
This will then pull down a number of images, each of which will display a series of unique image IDs, like the ones displayed in this example:

Once our image has finished downloading, we can start creating our first container:
docker run --name nginx-basic -d -p 81:80 nginx
If this...