Book Image

Docker High Performance. - Second Edition

By : Allan Espinosa, Russ McKendrick
Book Image

Docker High Performance. - Second Edition

By: Allan Espinosa, Russ McKendrick

Overview of this book

Docker is an enterprise-grade container platform that allows you to build and deploy your apps. Its portable format lets you run your code right from your desktop workstations to popular cloud computing providers. This comprehensive guide will improve your Docker work?ows and ensure your application's production environment runs smoothly. This book starts with a refresher on setting up and running Docker and details the basic setup for creating a Docker Swarm cluster. You will then learn how to automate this cluster by using the Chef server and cookbooks. After that, you will run the Docker monitoring system with Prometheus and Grafana, and deploy the ELK stack. You will also learn best practices for optimizing Docker images. After deploying containers with the help of Jenkins, you will then move on to a tutorial on using Apache JMeter to analyze your application's performance. You will learn how to use Docker Swarm and NGINX to load-balance your application, and how common debugging tools in Linux can be used to troubleshoot Docker containers. By the end of this book, you will be able to integrate all the optimizations that you have learned and put everything into practice in your applications.
Table of Contents (16 chapters)
Title Page
Copyright and Credits
About Packt

Using Chef

Chef is a configuration management tool that provides a domain-specific language to model the configuration of our infrastructure. Each configuration item in our infrastructure is modeled as a resource. A resource is basically a Ruby method that accepts several parameters in a block. The following example resource describes installing the docker-engine package:

package 'docker-engine' do
  action :install

These resources are then written together in Ruby source files called recipes. When running a recipe against a server (a Docker host in our case), all the defined resources are executed to reach its desired state configuration.

Some Chef recipes may depend on other supplemental items, such as configuration templates and other recipes. All this information is gathered in cookbooks together with the recipes. A cookbook is a fundamental unit of distributing configuration and policy to our servers.

We will write Chef recipes to represent the desired state configuration of our Docker...