Summary
In this chapter, you've been introduced to containers and have seen how they enable an application and its dependencies to be packaged together to enable it to be run simply on a machine with the Docker daemon running. We discussed Docker registries as a way of sharing images, including the commonly used public registry: Docker Hub. You were introduced to the docker
CLI and used this to run the nginx
image from Docker Hub, with Docker automatically pulling the image to the local machine from Docker Hub.
After running the nginx
image, you saw how to build an image from a custom web application using steps defined in a Dockerfile
. You saw how Docker builds image layers for steps in the Dockerfile
and reuses them in subsequent builds if files haven't changed, and also how this can be used to improve subsequent build times by carefully structuring the Dockerfile
so that the most commonly changing content is added in later steps.
After looking at how to work with...