April 2018
Intermediate to advanced
250 pages
5h 42m
English
We use Docker to prepare our software and its execution environment by packing them onto a file system. We call this step building a container image. OK, let's do this. We will build our own version of an NGINX server on Ubuntu, my-nginx, as a Docker image. Please note that the terms container image and Docker image will be used interchangeably throughout this book.
We create a directory called my-nginx and change to it:
$ mkdir my-nginx$ cd my-nginx
Then, we create a file named Dockerfile with the following content:
FROM ubuntuRUN apt-get update && apt-get install -y nginxEXPOSE 80ENTRYPOINT ["nginx", "-g", "daemon off;"]
We will explain the contents of Dockerfile line by line:
Read now
Unlock full access