<p><b>A practical guide to rapidly and efficiently mastering Docker containers, along with tips and tricks learned in the field.</b><p><b>About This Book</b><p><li>Use Docker containers, horizontal node scaling, modern orchestration tools (Docker Swarm, Kubernetes, and Mesos) and Continuous Integrat
Deployment with Docker
β Scribed by Grubor, Srdjan
- Publisher
- Packt Publishing
- Year
- 2017
- Tongue
- English
- Leaves
- 288
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
A practical guide to rapidly and efficiently mastering Docker containers, along with tips and tricks learned in the field. About This Book - Use Docker containers, horizontal node scaling, modern orchestration tools (Docker Swarm, Kubernetes, and Mesos) and Continuous Integration/Continuous Delivery to manage your infrastructure. - Increase service density by turning often-idle machines into hosts for numerous Docker services. - Learn what it takes to build a true container infrastructure that is scalable, reliable, and resilient in the face of increased complexities from using container infrastructures. - Find out how to identify, debug, and mitigate most real-world, undocumented issues when deploying your own Docker infrastructure. - Learn tips and tricks of the trade from existing Docker infrastructures running in production environments. Who This Book Is For This book is aimed at system administrators, developers, DevOps engineers, and software engineers who want to get concrete, hands-on experience deploying multi-tier web applications and containerized microservices using Docker. This book is also for anyone who has worked on deploying services in some fashion and wants to take their small-scale setups to the next level (or simply to learn more about the process). What You Will Learn - Set up a working development environment and create a simple web service to demonstrate the basics - Learn how to make your service more usable by adding a database and an app server to process logic - Add resilience to your services by learning how to horizontally scale with a few containers on a single node - Master layering isolation and messaging to simplify and harden the connectivity between containers - Learn about numerous issues encountered at scale and their workarounds, from the kernel up to code versioning - Automate the most important parts of your infrastructure with continuous integration In Detail Deploying Docker into production is considered to be one of the major pain points in developing large-scale infrastructures, and the documentation available online leaves a lot to be desired. With this book, you will learn everything you wanted to know to effectively scale your deployments globally and build a resilient, scalable, and containerized cloud platform for your own use. The book starts by introducing you to the containerization ecosystem with some concrete and easy-to-digest examples; after that, you will delve into examples of launching multiple instances of the same container. From there, you will cover orchestration, multi-node setups, volumes, and almost every relevant component of this new approach to deploying services. Using intertwined approaches, the book will cover battle-tested tooling, or issues likely to be encountered in real-world scenarios, in detail. You will also learn about the other supporting components required for a true PaaS deployment and discover common options to tie the whole infrastructure together. At the end of the book, you learn to build a small, but functional, PaaS (to appreciate the power of the containerized service approach) and continue to explore real-world approaches to implementing even larger global-scale services. Style and approach This in-depth learning guide shows you how to deploy your applications in production using Docker (from the basic steps to advanced concepts) and how to overcome challenges in Docker-based infrastructures. The book also covers practical use-cases in real-world examples, and provides tips and tricks on the various topics.
β¦ Table of Contents
Cover......Page 1
Copyright......Page 3
Credits......Page 5
About the Author......Page 6
Acknowledgments......Page 7
About the Reviewer......Page 8
www.PacktPub.com......Page 9
Customer Feedback......Page 10
Dedications......Page 11
Table of Contents......Page 12
Preface......Page 17
The what and why of containers......Page 22
Introduction to Docker containers......Page 25
rkt......Page 26
Desktop application-level virtualizations......Page 27
When should containerization be considered?......Page 28
The ideal Docker deployment......Page 30
The developer workflow......Page 31
Summary......Page 33
Installing Docker......Page 34
Debugging containers......Page 43
Seeing what the container sees......Page 44
Our first Dockerfile......Page 46
Breaking the cache......Page 49
A container more practical......Page 50
Ensuring the latest patches are included......Page 52
Applying our custom NGINX configuration......Page 53
Building and running......Page 54
Service from scratch......Page 57
Setting environment variables with ENV......Page 59
Container security layering with limited users......Page 60
VOLUMEs and data that lives outside of the container......Page 61
Changing the current user......Page 62
Putting it all together......Page 63
Summary......Page 67
A quick review......Page 68
Docker commands......Page 69
Dockerfile commands......Page 70
An overview......Page 71
What we are going to build......Page 73
Web server......Page 74
Authentication......Page 76
The database......Page 77
The application server......Page 78
The main application logic......Page 80
Running it all together......Page 85
Launching......Page 87
Testing......Page 88
Limitations and issues with our implementation......Page 90
Using a local volume......Page 91
Generating the credentials at runtime......Page 93
Introducing Docker networking......Page 94
Summary......Page 96
Service discovery......Page 97
Service Discovery in depth......Page 98
Client-side discovery pattern......Page 100
Hybrid systems......Page 101
Picking the (un)available options......Page 102
Container orchestration......Page 103
State reconciliation......Page 104
Docker Swarm......Page 105
Kubernetes......Page 106
Apache Mesos/Marathon......Page 107
Cloud-based offerings......Page 108
Setting up a Docker Swarm cluster......Page 109
Initializing a Docker Swarm cluster......Page 110
Deploying services......Page 111
Using Swarm to orchestrate our words service......Page 115
index.js......Page 116
The web server......Page 118
Database......Page 120
Deploying it all......Page 121
The Docker stack......Page 124
Clean up......Page 126
Summary......Page 127
Docker image internals......Page 128
How images are layered......Page 129
Persisting the writable CoW layer(s)......Page 130
Running your own image registry......Page 132
Underlying storage driver......Page 136
btrfs / zfs......Page 138
overlay and overlay2......Page 139
Manual cleanup......Page 140
Automatic cleanup......Page 141
Persistent storage......Page 143
Bind mounts......Page 144
Named volumes......Page 145
Relocatable volumes......Page 148
Relocatable volume sync loss......Page 154
UID/GID and security considerations with volumes......Page 155
Summary......Page 160
Advanced debugging......Page 161
Attaching to a container's process space......Page 162
Debugging the Docker daemon......Page 164
Static host configuration......Page 165
DNS configuration......Page 167
Docker built-in network mappings......Page 169
High availability pipelines......Page 170
Container messaging......Page 171
index.js......Page 175
Dockerfile......Page 177
Mounting the Docker socket into the container......Page 180
Host security scans......Page 182
Read-only containers......Page 184
Base system (package) updates......Page 186
Privileged mode versus --cap-add and --cap-drop......Page 187
Summary......Page 190
Limiting service resources......Page 191
RAM limits......Page 192
CPU limits......Page 200
ulimits......Page 204
Max file descriptors......Page 207
Socket buffers......Page 208
Ephemeral ports......Page 209
Netfilter tweaks......Page 211
Multi-service containers......Page 212
Zero-downtime deployments......Page 214
Rolling service restarts......Page 215
Blue-green deployments......Page 217
Blue-turquoise-green deployments......Page 219
Summary......Page 220
Chapter 8: Building Our Own Platform......Page 221
Configuration management......Page 222
Ansible......Page 223
Installation......Page 224
Basics......Page 225
Usage......Page 226
Amazon Web Services setup......Page 232
Creating an account......Page 233
Getting API keys......Page 234
Β Using the API keys......Page 237
Installation......Page 238
Usage......Page 239
Choosing the right AMI base image......Page 241
Building the AMI......Page 243
The road to automated infrastructure deployment......Page 245
Running the deployment and tear-down playbooks......Page 251
Continuous integration/Continuous delivery......Page 254
First-deploy circular dependency......Page 262
Further generic CI/CD uses......Page 264
Summary......Page 265
Chapter 9: Exploring the Largest-Scale Deployments......Page 266
Maintaining quorums......Page 267
Node automation......Page 270
Predictive auto-scaling......Page 272
Monitoring......Page 273
Evaluating next-gen technologies......Page 275
Technological needs......Page 276
Popularity......Page 277
A team's technical competency......Page 281
Summary......Page 282
Index......Page 283
Index......Page 0
β¦ Subjects
Nonfiction;Computer Science;Computers
π SIMILAR VOLUMES
<h4>Key Features</h4><ul><li>Use Docker containers, horizontal node scaling, modern orchestration tools (Docker Swarm, Kubernetes, and Mesos) and Continuous Integration/Continuous Delivery to manage your infrastructure.</li><li>Increase service density by turning often-idle machines into hosts for n
<h4>Key Features</h4><ul><li>Use Docker containers, horizontal node scaling, modern orchestration tools (Docker Swarm, Kubernetes, and Mesos) and Continuous Integration/Continuous Delivery to manage your infrastructure.</li><li>Increase service density by turning often-idle machines into hosts for n