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)

To get the most out of this book

You should have a developer workstation that you can install Docker on and use to test out the examples included in this book. You will learn the most by actually trying each of the examples yourself instead of just reading over them. In addition, you should have access to at least one other, but preferably two or three other, servers to configure as a Docker swarm. These servers can be EC2 instances in AWS; or VMs on VMware Workstation or Fusion; or, worst case scenario, VMs in VirtualBox. All of the software used throughout this book is free or open source, so you should be able to try out everything you are learning here. Most of the examples will work equally well regardless of the OS you are using, and I have tried to call out the differences where appropriate. You should have an account created on https://hub.docker.com, and an account on https://github.com. All of the code samples have been tested by me, as well as by several reviewers, so if you don't get them to work, double-check the code and try again, or download the code from Packt and cut and paste it into your system, and then try again. You'll get the hang of it.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Docker-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Code in action

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "In the networks key section, we are instructing Docker to create two networks, one named frontend and one named backend."

Any command-line input or output is written as follows:

# Enable autolock on your swarm cluster
docker swarm update --autolock=true
# Adjust certificate expiry to 30 days
docker swarm update --cert-expiry 720h

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Once the configuration has been saved, let's test the job by clicking on the Build Now link."

Warnings or important notes appear like this.
Tips and tricks appear like this.