Book Image

Docker Bootcamp

By : Russ McKendrick, Pethuru Raj, Jeeva S. Chelladhurai, Vinod Singh
Book Image

Docker Bootcamp

By: Russ McKendrick, Pethuru Raj, Jeeva S. Chelladhurai, Vinod Singh

Overview of this book

<p>Docker allows you to create a robust and resilient environment to generate portable, composable, scalable, and stable application containers.</p> <p>The book starts by installing the core Docker Engine on MacOS, Windows 10 and Linux desktops. We will then define multi-container applications and understand the advantages of using containers locally. Once this is done, we will deploy containers on a single Docker host which is publicly accessible. Furthermore, we will learn how to deploy and configure a Docker Swarm cluster and explore networking and storage third-party plugins to extend the core Docker functionality. Towards the end, the book will demonstrate how to monitor and troubleshoot day-to-day problems in addition to various real world examples of container deployments.</p>
Table of Contents (15 chapters)

The Dockerfile build instructions


So far, we have looked at the integrated build system, the Dockerfile syntax and a sample lifecycle, wherein how a sample Dockerfile is leveraged for generating an image and how a container gets spun off from that image was discussed. In this section, we will introduce the Dockerfile instructions, their syntax, and a few befitting examples.

The FROM instruction

The FROM instruction is the most important one and it is the first valid instruction of a Dockerfile. It sets the base image for the build process. The subsequent instructions will use this base image and build on top of it. The Docker build system lets you flexibly use the images built by anyone. You can also extend them by adding more precise and practical features to them. By default, the Docker build system looks in the Docker host for the images.

However, if the image is not found in the Docker host, then the Docker build system will pull the image from the publicly available Docker Hub Registry...