Book Image

Docker Quick Start Guide

By : Earl Waud
Book Image

Docker Quick Start Guide

By: Earl Waud

Overview of this book

Docker is an open source software platform that helps you with creating, deploying, and running your applications using containers. This book is your ideal introduction to Docker and containerization. You will learn how to set up a Docker development environment on a Linux, Mac, or Windows workstation, and learn your way around all the commands to run and manage your Docker images and containers. You will explore the Dockerfile and learn how to build your own enterprise-grade Docker images. Then you will learn about Docker networks, Docker swarm, and Docker volumes, and how to use these features with Docker stacks in order to define, deploy, and maintain highly-scalable, fault-tolerant multi-container applications. Finally, you will learn how to leverage Docker with Jenkins to automate the building of Docker images and the deployment of Docker containers. By the end of this book, you will be well prepared when it comes to using Docker for your next project.
Table of Contents (10 chapters)

What is a Dockerfile?

You learned in Chapter 2, Learning Docker Commands, that you can run a Docker container, make modifications to that running container, and then using the docker commit command, save those changes, effectively creating a new Docker image. Although this method works, it is not the preferred way to create Docker containers. The best way to create Docker images is to use the Docker image build command with a Dockerfile that describes your desired image.

A Dockerfile (yes, the correct spelling is all one word, with a capital D) is a text file that contains instructions used by the Docker daemon to create a Docker image. The instructions are defined using a type of value pair syntax. Each one has an instruction word followed by the parameters for that instruction. Every command gets its own line in the Dockerfile. Although the Dockerfile instructions are not case...