Using Docker: Developing and Deploying Software with Containers

Docker containers offer simpler, faster, and more robust methods for developing, distributing, and running software than previously available. With this hands-on guide, you’ll learn why containers are so important, what you’ll gain by adopting Docker, and how to make it part of your development process.

Ideal for developers, operations engineers, and system administrators—especially those keen to embrace a DevOps approach—Using Docker will take you from Docker and container basics to running dozens of containers on a multi-host system with networking and scheduling. The core of the book walks you through the steps needed to develop, test, and deploy a web application with Docker.

  • Get started with Docker by building and deploying a simple web application
  • Use Continuous Deployment techniques to push your application to production multiple times a day
  • Learn various options and techniques for logging and monitoring multiple containers
  • Examine networking and service discovery: how do containers find each other and how do you connect them?
  • Orchestrate and cluster containers to address load-balancing, scaling, failover, and scheduling
  • Secure your system by following the principles of defense-in-depth and least privilege
1123141239
Using Docker: Developing and Deploying Software with Containers

Docker containers offer simpler, faster, and more robust methods for developing, distributing, and running software than previously available. With this hands-on guide, you’ll learn why containers are so important, what you’ll gain by adopting Docker, and how to make it part of your development process.

Ideal for developers, operations engineers, and system administrators—especially those keen to embrace a DevOps approach—Using Docker will take you from Docker and container basics to running dozens of containers on a multi-host system with networking and scheduling. The core of the book walks you through the steps needed to develop, test, and deploy a web application with Docker.

  • Get started with Docker by building and deploying a simple web application
  • Use Continuous Deployment techniques to push your application to production multiple times a day
  • Learn various options and techniques for logging and monitoring multiple containers
  • Examine networking and service discovery: how do containers find each other and how do you connect them?
  • Orchestrate and cluster containers to address load-balancing, scaling, failover, and scheduling
  • Secure your system by following the principles of defense-in-depth and least privilege
38.49 In Stock
Using Docker: Developing and Deploying Software with Containers

Using Docker: Developing and Deploying Software with Containers

by Adrian Mouat
Using Docker: Developing and Deploying Software with Containers

Using Docker: Developing and Deploying Software with Containers

by Adrian Mouat

eBook

$38.49  $50.99 Save 25% Current price is $38.49, Original price is $50.99. You Save 25%.

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Docker containers offer simpler, faster, and more robust methods for developing, distributing, and running software than previously available. With this hands-on guide, you’ll learn why containers are so important, what you’ll gain by adopting Docker, and how to make it part of your development process.

Ideal for developers, operations engineers, and system administrators—especially those keen to embrace a DevOps approach—Using Docker will take you from Docker and container basics to running dozens of containers on a multi-host system with networking and scheduling. The core of the book walks you through the steps needed to develop, test, and deploy a web application with Docker.

  • Get started with Docker by building and deploying a simple web application
  • Use Continuous Deployment techniques to push your application to production multiple times a day
  • Learn various options and techniques for logging and monitoring multiple containers
  • Examine networking and service discovery: how do containers find each other and how do you connect them?
  • Orchestrate and cluster containers to address load-balancing, scaling, failover, and scheduling
  • Secure your system by following the principles of defense-in-depth and least privilege

Product Details

ISBN-13: 9781491915912
Publisher: O'Reilly Media, Incorporated
Publication date: 12/09/2015
Sold by: Barnes & Noble
Format: eBook
Pages: 354
File size: 5 MB

About the Author

Adrian Mouat is Chief Scientist at Container Solutions. In the past he has worked on a wide range of software projects, from small webapps to large scale data-analysis software.

Table of Contents

Preface xi

Part I Background and Basics

1 The What and Why of Containers 3

Containers Versus VMs 4

Docker and Containers 6

Docker: A History 8

Plugins and Plumbing 10

64-Bit Linux 10

2 Installation 13

Installing Docker on Linux 13

Run SELinux in Permissive Mode 14

Running Without sudo 15

Installing Docker on Mac OS or Windows 15

A Quick Check 17

3 First Steps 19

Running Your First Image 19

The Basic Commands 20

Building Images from Dockerfiles 24

Working with Registries 27

Private Repositories 29

Using the Redis Official Image 30

Conclusion 33

4 Docker Fundamentals 35

The Docker Architecture 35

Underlying Technologies 36

Surrounding Technologies 37

Docker Hosting 39

How Images Get Built 39

The Build Context 40

Image Layers 41

Caching 43

Base Images 44

Dockerfile Instructions 46

Connecting Containers to the World 49

Linking Containers 49

Managing Data with Volumes and Data Containers 51

Sharing Data 53

Data Containers 54

Common Docker Commands 55

The run Command 56

Managing Containers 59

Docker Info 62

Container Info 62

Dealing with Images 63

Using the Registry 66

Conclusion 67

Part II The Software Lifecycle with Docker

5 Using Docker in Development 71

Say "Hello World!" 71

Automating with Compose 81

The Compose Workflow 83

Conclusion 84

6 Creating a Simple Web App 85

Creating a Basic Web Page 87

Taking Advantage of Existing Images 88

Add Some Caching 93

Microservices 96

Conclusion 97

7 Image Distribution 99

Image and Repository Naming 99

The Docker Hub 100

Automated Builds 102

Private Distribution 104

Running Your Own Registry 104

Commerical Registries 111

Reducing Image Size 111

Image Provenance 113

Conclusion 114

8 Continuous Integration and Testing with Docker 115

Adding Unit Tests to Identidock 116

Creating a Jenkins Container 121

Triggering Builds 128

Pushing the Image 129

Responsible Tagging 129

Staging and Production 131

Image Sprawl 131

Using Docker to Provision Jenkins Slaves 132

Backing Up Jenkins 132

Hosted CI Solutions 133

Testing and Microservices 133

Testing in Production 135

Conclusion 135

9 Deploying Containers 137

Provisioning Resources with Docker Machine 138

Using a Proxy 141

Execution Options 147

Shell Scripts 148

Using a Process Manager (or systemd to Rule Them All) 150

Using a Configuration Management Tool 153

Host Configuration 157

Choosing an OS 157

Choosing a Storage Driver 157

Specialist Hosting Options 160

Triton 160

Google Container Engine 162

Amazon EC2 Container Service 162

Giant Swarm 165

Persistent Data and Production Containers 167

Sharing Secrets 167

Saving Secrets in the Image 167

Passing Secrets in Environment Variables 168

Passing Secrets in Volumes 168

Using a Key-Value Store 169

Networking 170

Production Registry 170

Continuous Deployment/Delivery 171

Conclusion 171

10 Logging and Monitoring 173

Logging 174

The Default Docker Logging 174

Aggregating Logs 176

Logging with ELK 177

Docker Logging with syslog 187

Grabbing Logs from File 193

Monitoring and Alerting 194

Monitoring with Docker Tools 194

cAdvisor 196

Cluster Solutions 197

Commercial Monitoring and Logging Solutions 201

Conclusion 201

Part III Tools and Techniques

11 Networking and Service Discovery 205

Ambassadors 206

Service Discovery 210

Etcd 210

SkyDNS 215

Consul 219

Registration 223

Other Solutions 225

Networking Options 226

Bridge 226

Host 227

Container 228

None 228

New Docker Networking 228

Network Types and Plugins 230

Networking Solutions 230

Overlay 231

Weave 233

Flannel 237

Project Calico 243

Conclusion 247

12 Orchestration, Clustering, and Management 251

Clustering and Orchestration Tools 252

Swarm 253

Fleet 259

Kubernetes 265

Mesos and Marathon 273

Container Management Platforms 284

Rancher 284

Clocker 286

Tutum 287

Conclusion 288

13 Security and Limiting Containers 291

Things to Worry About 292

Defense-in-Depth 294

Least Privilege 294

Securing Identidock 295

Segregate Containers by Host 297

Applying Updates 298

Avoid Unsupported Drivers 301

Image Provenance 302

Docker Digests 302

Docker Content Trust 303

Reproducible and Trustworthy Dockerfiles 307

Security Tips 309

Set a User 310

Limit Container Networking 311

Remove Setuid/Setgid Binaries 313

Limit Memory 314

Limit CPU 315

Limit Restarts 316

Limit Filesystems 316

Limit Capabilities 317

Apply Resource Limits (ulimits) 318

Run a Hardened Kernel 320

Linux Security Modules 320

SELinux 321

App Armor 324

Auditing 324

Incident Response 325

Future Features 326

Conclusion 326

Index 329

From the B&N Reads Blog

Customer Reviews