Now that we're armed with a good understanding of the Dockerfile constructs, in this recipe we will build a very simple Docker image that bundles the apache2 web server and also adds metadata to launch the apache2 application inside the container whenever a new container is created from this image.
Building an Apache image – a Dockerfile example
Getting ready
Before we begin, the git repository https://github.com/docker-cookbook/apache2 has a Dockerfile to build an apache2 image, so clone the repository as shown in the following code:
$ git clone https://github.com/docker-cookbook/apache2.git
Now, go to the apache2 directory:
$ cd apache2 $ cat Dockerfile FROM alpine:3.6 LABEL maintainer...