Docker in Practice - Ian Miell, Aiden Hobson Sayers

Docker in Practice

Buch | Softcover
372 Seiten
2016
Manning Publications (Verlag)
978-1-61729-272-9 (ISBN)
43,75 inkl. MwSt
zur Neuauflage
  • Keine Verlagsinformationen verfügbar
  • Artikel merken
Zu diesem Artikel existiert eine Nachauflage
Docker is impossible to ignore. This lightweight container system is easier to deploy and more flexible than traditional VMs. Built for simplicity and speed, it radically reduces your reliance on manual system administration for tasks like configuring servers, creating disposable (and portable!) development environments, and predictably rolling out applications on unknown systems. While the idea behind Docker is simple, it can have a major impact on how software is developed and deployed.

Docker in Practice is a hands-on guide to over 100 specific techniques that can be used to get the most out of Docker. Following a cookbook-style Problem/Solution/Discussion format, this practical handbook offers instantly-useful solutions for important areas like effortless server maintenance and configuration, deploying microservices, creating safe environments for experimentation, and much more. The book takes readers from Docker basics to must-have practices like integrating Docker with Continuous Integration process, automating complex container creation with Chef, and orchestration with Kubernetes.

KEY SELLING POINTS
Proven strategies for using Docker in dev and CI
Covers common and explores two of the most important concepts
Goes from development to production
Walks through varied and often surprising use cases for Docker

Written for developers and devops engineers who have already started their Docker journey and want to use it effectively in a production setting.

ABOUT THE TECHNOLOGY
Docker is one of the fastest-adopted technologies in software, and when the likes of RedHat, Microsoft and VMWare all partner with a startup you know it's going to be big. Docker is cheaper, easier, faster, and more powerful than VMs, and it will affect everyone involved in software sooner rather than later.

Ian Miell is an experienced software engineer who first recognized the potential of Docker in his company and created his own tool in the Docker ecosystem.

Aidan Hobson Sayers has a strong interest in the practical detail and often dives into the Docker source code. Both have contributed to Docker and have extensive experience of building and maintaining a Docker infrastructure in a commercially pressured development environment.

Foreword
Preface
Acknowledgments
About this Book
Roadmap
Code
Author Online
About the Cover Illustration

Part 1: Docker fundamentals
1. Discovering Docker
1.1. The what and why of Docker
1.1.1. What is Docker?
1.1.2. What is Docker good for?
1.1.3. Key concepts
1.2. Building a Docker application
1.2.1. Ways to create a new Docker image
1.2.2. Writing a Dockerfile
1.2.3. Building a Docker image
1.2.4. Running a Docker container
1.2.5. Docker layering
1.3. Summary

2. Understanding Docker—inside the engine room
2.1. Docker's architecture
2.2. The Docker daemon
Technique 1 Open your Docker daemon to the world
Problem
Solution
Discussion
Technique 2 Running containers as daemons
Problem
Solution
Discussion
Technique 3 Moving Docker to a different partition
Problem
Solution
Discussion
2.3. The Docker client
Technique 4 Use socat to monitor Docker API traffic
Problem
Solution
Discussion
Technique 5 Using ports to connect to containers
Problem
Solution
Discussion
Technique 6 Linking containers for port isolation
Problem
Solution
Discussion
Technique 7 Using Docker in your browser
Problem
Solution
Discussion
2.4. Docker registries
Technique 8 Setting up a local Docker registry
Problem
Solution
Discussion
2.5. The Docker Hub
Technique 9 Finding and running a Docker image
Problem
Solution
Discussion
2.6. Summary

Part 2: Docker and development
3. Using Docker as a lightweight virtual machine
3.1. From VM to container
Technique 10 Converting your VM to a container
Problem
Solution
Discussion
Technique 11 A host-like container
Problem
Solution
Discussion
Technique 12 Splitting a system into microservice containers
Problem
Solution
Discussion
3.2. Managing services on your containers
Technique 13 Managing the startup of your container's services
Problem
Solution
Discussion
3.3. Saving and restoring your work
Technique 14 The "save game" approach to development
Problem
Solution
Discussion
Technique 15 Docker tagging
Problem
Solution
Discussion
Technique 16 Sharing images on the Docker Hub
Problem
Solution
Discussion
Technique 17 Referring to a specific image in builds
Problem
Solution
Discussion
3.4. Environments as processes
Technique 18 The "save game" approach to development
Problem
Solution
Discussion
3.5. Summary

4. Day-to-day Docker
4.1. Volumes—a persistent problem
Technique 19 Docker volumes—problems of persistence
Problem
Solution
Discussion
Technique 20 Distributed volumes with BitTorrent Sync
Problem
Solution
Discussion
Technique 21 Retain your container's bash history
Problem
Solution
Discussion
Technique 22 Data containers
Problem
Solution
Discussion
Technique 23 Remote volume mounting using sshfs
Problem
Solution
Discussion
Technique 24 Sharing data over NFS
Problem
Solution
Discussion
Technique 25 Dev tools container
Problem
Solution
Discussion
4.2. Running containers
Technique 26 Running GUIs within Docker
Problem
Solution
Discussion
Technique 27 Inspecting containers
Problem
Solution
Discussion
Technique 28 Cleanly killing containers
Problem
Solution
Discussion
Technique 29 Using Docker Machine to provision Docker hosts
Problem
Solution
Discussion
4.3. Building images
Technique 30 Injecting files into your image using ADD
Problem
Solution
Discussion
Technique 31 Rebuilding without the cache
Problem
Solution
Discussion
Technique 32 Busting the cache
Problem
Solution
Discussion
4.4. Staying ship-shape
Technique 33 Running Docker without sudo
Problem
Solution
Discussion
Technique 34 Housekeeping containers
Problem
Solution
Discussion
Technique 35 Housekeeping volumes
Problem
Solution
Discussion
Technique 36 Detaching containers without stopping them
Problem
Solution
Discussion
Technique 37 Using DockerUI to manage your Docker daemon
Problem
Solution
Discussion
Technique 38 Generate a dependency graph of your Docker images
Problem
Solution
Discussion
Technique 39 Direct action—execute commands on your container
Problem
Solution
Discussion
4.5. Summary

5. Configuration management—getting your house in order
5.1. Configuration management and Dockerfiles
Technique 40 Create reliable bespoke tools with ENTRYPOINT
Problem
Solution
Discussion
Technique 41 Avoid package drift by specifying versions in your build
Problem
Solution
Discussion
Technique 42 Replacing text with perl -p -i -e
Problem
Solution
Discussion
Technique 43 Flattening images
Problem
Solution
Discussion
Technique 44 Managing foreign packages with alien
Problem
Solution
Discussion
Technique 45 Reverse-engineer a Dockerfile from an image
Problem
Solution
Discussion
5.2. Traditional configuration management tools with Docker
Technique 46 Traditional: using make with Docker
Problem
Solution
Discussion
Technique 47 Building images with Chef Solo
Problem
Solution
Discussion
Technique 48 Source-to-image builds
Problem
Solution
Discussion
5.3. Small is beautiful
Technique 49 Dockerfile tricks for keeping your build small
Problem
Solution
Discussion
Technique 50 Tricks for making an image smaller
Problem
Solution
Discussion
Technique 51 Tiny Docker images with BusyBox and Alpine
Problem
Solution
Discussion
Technique 52 The Go model of minimal containers
Problem
Solution
Discussion
Technique 53 Using inotifywait to slim containers
Problem
Solution
Discussion
Technique 54 Big can be beautiful
Problem
Solution
Discussion
5.4. Summary

Part 3: Docker and DevOps
6. Continuous integration: speeding up your development pipeline
6.1. Docker Hub automated builds
Technique 55 Using the Docker Hub workflow
Problem
Solution
Discussion
6.2. More efficient builds
Technique 56 Speed up I/O-intensive builds with eatmydata
Problem
Solution
Discussion
Technique 57 Set up a package cache for faster builds
Problem
Solution
Discussion
Technique 58 Running Selenium tests inside Docker
Problem
Solution
Discussion
6.3. Containerizing your CI process
Technique 59 Containing a complex development environment
Problem
Solution
Discussion
Technique 60 Running the Jenkins master within a Docker container
Problem
Solution
Discussion
Technique 61 Scale your CI with Jenkins' Swarm plugin
Problem
Solution
Discussion
6.4. Summary

7. Continuous delivery: a perfect fit for Docker principles
7.1. Interacting with other teams during the CD pipeline
Technique 62 The Docker contract—reducing friction
Problem
Solution
Discussion
7.2. Facilitating deployment of Docker images
Technique 63 Manually mirroring registry images
Problem
Solution
Discussion
Technique 64 Delivering images over constrained connections
Problem
Solution
Discussion
Technique 65 Sharing Docker objects as TAR files
Problem
Solution
Discussion
7.3. Configuring your images for environments
Technique 66 Informing your containers with etcd
Problem
Solution
Discussion
7.4. Upgrading running containers
Technique 67 Using confd to enable zero-downtime switchover
Problem
Solution
Discussion
7.5. Summary

8. Network simulation: realistic environment testing without the pain
8.1. Container communication—beyond manual linking
Technique 68 A simple Docker Compose cluster
Problem
Solution
Discussion
Technique 69 A SQLite server using Docker Compose
Problem
Solution
Discussion
Technique 70 Finding containers via DNS with Resolvable
Problem
Solution
Discussion
8.2. Using Docker to simulate real-world networking
Technique 71 Simulating troublesome networks with Comcast
Problem
Solution
Discussion
Technique 72 Simulating troublesome networks with Blockade
Problem
Solution
Discussion
8.3. Docker and virtual networks
Technique 73 Setting up a substrate network with Weave
Problem
Solution
Discussion
Technique 74 Docker networking and service features
Problem
Solution
Discussion
8.4. Summary

Part 4: Docker in production
9. Container orchestration: managing multiple Docker containers
9.1. Simple single-host Docker
Technique 75 Managing your host's containers with systemd
Problem
Solution
Discussion
Technique 76 Orchestrating your host's containers with systemd
Problem
Solution
Discussion
9.2. Multi-host Docker
Technique 77 Manual multi-host Docker with Helios
Problem
Solution
Discussion
Technique 78 A seamless Docker cluster with Swarm
Problem
Solution
Discussion
Technique 79 Using a Kubernetes cluster
Problem
Solution
Discussion
Technique 80 Building a framework on Mesos
Problem
Solution
Discussion
Technique 81 Micromanaging Mesos with Marathon
Problem
Solution
Discussion
9.3. Service discovery: what have we here?
Technique 82 Using Consul to discover services
Problem
Solution
Discussion
Technique 83 Automatic service registration with Registrator
Problem
Solution
Discussion
9.4. Summary

10. Docker and security
10.1. Docker access and what it means
10.1.1. Do you care?
10.2. Security measures in Docker
Technique 84 Constraining capabilities
Problem
Solution
Discussion
Technique 85 HTTP auth on your Docker instance
Problem
Solution
Discussion
Technique 86 Securing your Docker API
Problem
Solution
Discussion
10.3. Security from outside Docker
Technique 87 OpenShift—an application platform as a service
Problem
Solution
Discussion
Technique 88 Using security options
Problem
Solution
Discussion
10.4. Summary

11. Plain sailing—Docker in production and operational considerations
11.1. Monitoring
Technique 89 Logging your containers to the host's syslog
Problem
Solution
Discussion
Technique 90 Sending Docker logs to your host's output system
Problem
Solution
Discussion
Technique 91 Monitoring containers with cAdvisor
Problem
Solution
Discussion
11.2. Resource control
Technique 92 Restricting the cores a container can execute on
Problem
Solution
Discussion
Technique 93 Giving important containers more CPU
Problem
Solution
Discussion
Technique 94 Limiting the memory usage of a container
Problem
Solution
Discussion
11.3. Sysadmin use cases for Docker
Technique 95 Using Docker to run cron jobs
Problem
Solution
Discussion
Technique 96 The "save game" approach to backups
Problem
Solution
Discussion
11.4. Summary

12. Docker in production—dealing with challenges
12.1. Performance—you can't ignore the tin
Technique 97 Accessing host resources from the container
Problem
Solution
Discussion
Technique 98 Device Mapper storage driver and default container size
Problem
Solution
Discussion
12.2. When containers leak—debugging Docker
Technique 99 Debugging a container's network with nsenter
Problem
Solution
Discussion
Technique 100 Using tcpflow to debug in flight without reconfiguring
Problem
Solution
Discussion
Technique 101 Debugging containers that fail on specific hosts
Problem
Solution
Discussion
12.3. Summary
Appendixes

Appendix A: Installing and using Docker
A.1. The virtual machine approach
A.2. Docker client connected to an external Docker server
A.3. Native Docker client and virtual machine
A.3.1. Docker on Windows
A.4. Getting help

Appendix B: Docker configuration
B.1. Restarting Docker
B.1.1. Restarting with systemctl
B.1.2. Restarting with service

Appendix C: Vagrant
C.1. Setting up
C.2. GUIs
C.3. Memory
Index
SYMBOL
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
List of Figures
List of Tables
List of Listings

Erscheint lt. Verlag 10.5.2016
Verlagsort New York
Sprache englisch
Maße 191 x 239 mm
Gewicht 638 g
Themenwelt Mathematik / Informatik Informatik Betriebssysteme / Server
Mathematik / Informatik Informatik Software Entwicklung
Mathematik / Informatik Informatik Theorie / Studium
Mathematik / Informatik Informatik Web / Internet
ISBN-10 1-61729-272-9 / 1617292729
ISBN-13 978-1-61729-272-9 / 9781617292729
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich