Book Image

The Docker Workshop

By : Vincent Sesto, Onur Yılmaz, Sathsara Sarathchandra, Aric Renzo, Engy Fouda
5 (1)
Book Image

The Docker Workshop

5 (1)
By: Vincent Sesto, Onur Yılmaz, Sathsara Sarathchandra, Aric Renzo, Engy Fouda

Overview of this book

No doubt Docker Containers are the future of highly-scalable software systems and have cost and runtime efficient supporting infrastructure. But learning it might look complex as it comes with many technicalities. This is where The Docker Workshop will help you. Through this workshop, you’ll quickly learn how to work with containers and Docker with the help of practical activities.? The workshop starts with Docker containers, enabling you to understand how it works. You’ll run third party Docker images and also create your own images using Dockerfiles and multi-stage Dockerfiles. Next, you’ll create environments for Docker images, and expedite your deployment and testing process with Continuous Integration. Moving ahead, you’ll tap into interesting topics and learn how to implement production-ready environments using Docker Swarm. You’ll also apply best practices to secure Docker images and to ensure that production environments are running at maximum capacity. Towards the end, you’ll gather skills to successfully move Docker from development to testing, and then into production. While doing so, you’ll learn how to troubleshoot issues, clear up resource bottlenecks and optimize the performance of services. By the end of this workshop, you’ll be able to utilize Docker containers in real-world use cases.
Table of Contents (17 chapters)
Preface

Stateful versus Stateless Containers/Services

Containers and services can run in two modes: stateful and stateless. A stateless service is the one that does not retain persistent data. This type is much easier to scale and update than the stateful one. A stateful service requires persistent storage (as in databases). Therefore, it is harder to dockerize because stateful services need synchronization with the other components of the application.

Say you're dealing with an application that needs a certain file in order to work correctly. If this file is saved inside a container, as in the stateful mode, when this container is removed for whatever reason, the whole application crashes. However, if this file is saved in a volume or an external database, any container will be able to access it, and the application will work fine. Say business is booming and we need to scale up the number of containers running to fulfill the clients' needs. All the containers will be able to...