万本电子书0元读

万本电子书0元读

顶部广告

Deployment with Docker电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:Srdjan Grubor

出  版  社:Packt Publishing

出版时间:2017-11-22

字       数:36.1万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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 ForThis 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 integrationIn DetailDeploying 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 approachThis 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.
目录展开

Title Page

Credits

About the Author

Acknowledgments

About the Reviewer

www.PacktPub.com

Why subscribe?

Customer Feedback

Dedications

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

Containers - Not Just Another Buzzword

The what and why of containers

Docker's place

Introduction to Docker containers

The competition

rkt

System-level virtualization

Desktop application-level virtualizations

When should containerization be considered?

The ideal Docker deployment

The container mindset

The developer workflow

Summary

Rolling Up the Sleeves

Installing Docker

Debugging containers

Seeing what the container sees

Our first Dockerfile

Breaking the cache

A container more practical

Extending another container with FROM

Ensuring the latest patches are included

Applying our custom NGINX configuration

Building and running

Service from scratch

Labels

Setting environment variables with ENV

Exposing ports

Container security layering with limited users

VOLUMEs and data that lives outside of the container

Setting the working directory

Adding files from the internet

Changing the current user

Putting it all together

Summary

Service Decomposition

A quick review

Docker commands

Dockerfile commands

Writing a real service

An overview

What we are going to build

The implementation

Web server

Authentication

The database

The application server

The main application logic

Running it all together

Launching

Testing

Limitations and issues with our implementation

Fixing the critical issues

Using a local volume

Generating the credentials at runtime

Introducing Docker networking

Summary

Scaling the Containers

Service discovery

A recap of Docker networking

Service Discovery in depth

Client-side discovery pattern

Server-side discovery pattern

Hybrid systems

Picking the (un)available options

Container orchestration

State reconciliation

Docker Swarm

Kubernetes

Apache Mesos/Marathon

Cloud-based offerings

Implementing orchestration

Setting up a Docker Swarm cluster

Initializing a Docker Swarm cluster

Deploying services

Cleaning up

Using Swarm to orchestrate our words service

The application server

index.js

The web server

Database

Deploying it all

The Docker stack

Clean up

Summary

Keeping the Data Persistent

Docker image internals

How images are layered

Persisting the writable CoW layer(s)

Running your own image registry

Underlying storage driver

aufs

btrfs / zfs

overlay and overlay2

devicemapper

Cleanup of Docker storage

Manual cleanup

Automatic cleanup

Persistent storage

Node-local storage

Bind mounts

Read-only bind mounts

Named volumes

Relocatable volumes

Relocatable volume sync loss

UID/GID and security considerations with volumes

Summary

Advanced Deployment Topics

Advanced debugging

Attaching to a container's process space

Debugging the Docker daemon

Advanced networking

Static host configuration

DNS configuration

Overlay networks

Docker built-in network mappings

Docker communication ports

High availability pipelines

Container messaging

Implementing our own messaging queue

package.json

index.js

Dockerfile

Advanced security

Mounting the Docker socket into the container

Host security scans

Read-only containers

Base system (package) updates

Privileged mode versus --cap-add and --cap-drop

Summary

The Limits of Scaling and the Workarounds

Limiting service resources

RAM limits

CPU limits

Pitfall avoidance

ulimits

Max file descriptors

Socket buffers

Ephemeral ports

Netfilter tweaks

Multi-service containers

Zero-downtime deployments

Rolling service restarts

Blue-green deployments

Blue-turquoise-green deployments

Summary

Building Our Own Platform

Configuration management

Ansible

Installation

Basics

Usage

Amazon Web Services setup

Creating an account

Getting API keys

Using the API keys

HashiCorp Packer

Installation

Usage

Choosing the right AMI base image

Building the AMI

Deployments to AWS

The road to automated infrastructure deployment

Running the deployment and tear-down playbooks

Continuous integration/Continuous delivery

Resource considerations

First-deploy circular dependency

Further generic CI/CD uses

Summary

Exploring the Largest-Scale Deployments

Maintaining quorums

Node automation

Reactive auto-scaling

Predictive auto-scaling

Monitoring

Evaluating next-gen technologies

Technological needs

Popularity

A team's technical competency

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部