Book Image

Docker for Developers

By : Richard Bullington-McGuire, Andrew K. Dennis, Michael Schwartz
2 (1)
Book Image

Docker for Developers

2 (1)
By: Richard Bullington-McGuire, Andrew K. Dennis, Michael Schwartz

Overview of this book

Docker is the de facto standard for containerizing apps, and with an increasing number of software projects migrating to containers, it is crucial for engineers and DevOps teams to understand how to build, deploy, and secure Docker environments effectively. Docker for Developers will help you understand Docker containers from scratch while taking you through best practices and showing you how to address security concerns. Starting with an introduction to Docker, you’ll learn how to use containers and VirtualBox for development. You’ll explore how containers work and develop projects within them after you’ve explored different ways to deploy and run containers. The book will also show you how to use Docker containers in production in both single-host set-ups and in clusters and deploy them using Jenkins, Kubernetes, and Spinnaker. As you advance, you’ll get to grips with monitoring, securing, and scaling Docker using tools such as Prometheus and Grafana. Later, you’ll be able to deploy Docker containers to a variety of environments, including the cloud-native Amazon Elastic Kubernetes Service (Amazon EKS), before finally delving into Docker security concepts and best practices. By the end of the Docker book, you’ll be able to not only work in a container-driven environment confidently but also use Docker for both new and existing projects.
Table of Contents (21 chapters)
1
Section 1: An Introduction to Docker – Containers and Local Development
6
Section 2: Running Docker in Production
14
Section 3: Docker Security – Securing Your Containers

Limitations of single-host deployment

What could go wrong with deploying a Docker application to a single host? Plenty! While single-host deployment offers operational simplicity, it has some major limitations. Let's look at some of the limitations in the following sections.

No automatic failover

If either the database server container or the web service container fails and cannot be restarted automatically, the site will be down and will require manual intervention. This might be as simple as noticing that your monitoring system says that the site is down, and so you need to SSH in and reboot the server. But sometimes, a single server will be so low on memory that it must be manually rebooted from a higher-level console or even power-cycled manually. This tends to lead to significant periods of time where an application is down and not available to serve requests.

Inability to scale horizontally to accept more load

What happens if the traffic for the system exceeds...