Docker in Practice - Ian Miell, Aiden Hobson Sayers

Docker in Practice

Buch | Softcover
384 Seiten
2019 | 2nd edition
Manning Publications (Verlag)
978-1-61729-480-8 (ISBN)
53,95 inkl. MwSt
Docker's simple idea, wrapping an application and its dependencies into a single deployable package, has continued to drive a revolution in software delivery.

Docker in Practice, Second Edition presents nearly 120 practical techniques, hand-picked to help users get the most out of Docker. This book is an essential resource that readers will want to have open on their desk!

Key features
* Hands-on guide
* Step-by-step instructions
* Full of practical tips

Written for developers and engineers using Docker in production.

About the technology
Docker is a platform that allows users to "build, ship, and run any app, anywhere." It has come a long way in an incredibly short time and is now considered a standard way of solving one of the costliest aspects of software: deployment.

Ian Miell is the Lead OpenShift Architect at Barclays.

Aidan Hobson Sayers is a developer at Hadean. Previously, they used Docker to transform DevOps at OpenBet.

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
Technique 2 Running containers as daemons
Technique 3 Moving Docker to a different partition
2.3 The Docker client
Technique 4 Use socat to monitor Docker API traffic
Technique 5 Using Docker in your browser
Technique 6 Using ports to connect to containers
Technique n Allowing container communication with user-defined networks
Technique 7 Linking containers for port isolation
Technique 8 Setting up a local Docker registry
2.4 Docker registries
Technique 9 Finding and running a Docker image
2.5 The Docker Hub
Technique 10 Finding and running a Docker image
Summary

Part 2: Docker and development
3 Using Docker as a lightweight virtual machine
3.1 From VM to container
Technique 11 Converting your VM to a container
Technique 12 A host-like container
Technique 13 Splitting a system into microservice containers
Technique 14 Managing the startup of your container’s services
3.2 Saving and restoring your work
Technique 15 The “save game” approach: Cheap source control
Technique 16 Docker tagging
Technique 17 Sharing images on the Docker Hub
Technique 18 Referring to a specific image in builds
3.3 Environments as processes
Technique 19 The “save game” approach: Winning at 2048
Summary

4 Building Images
4.1 Building images
Technique 20 Injecting files into your image using ADD
Technique 21 Rebuilding without the cache
Technique 22 Busting the cache
Technique 23 Intelligent cache-busting using build-args
Technique 24 Intelligent cache-busting using the ADD directive
Technique 25 Setting the right time zone in your containers
Technique 26 Locale management
Technique 27 Stepping through layers with the image-stepper
Technique 28 Onbuild and golang
Summary

5 Running containers
5.1 Running containers
Technique 29 Running GUIs within Docker
Technique 30 Inspecting containers
Technique 31 Cleanly killing containers
Technique 32 Using Docker Machine to provision Docker hosts
Technique 33 Wildcard DNS
5.2 Volumes—​a persistent problem
Technique 34 Docker volumes: Problems of persistence
Technique 35 Distributed volumes with Resilio Sync
Technique 36 Retaining your container’s bash history
Technique 37 Data containers
Technique 38 Remote volume mounting using SSHFS
Technique 39 Sharing data over NFS
Technique 40 Dev tools container
Summary

6 Day-to-day Docker
6.1 Staying ship-shape
Technique 34 Docker volumes: Problems of persistence
Technique 35 Distributed volumes with Resilio Sync
Technique 36 Retaining your container’s bash history
Technique 37 Data containers
Technique 38 Remote volume mounting using SSHFS
Technique 39 Sharing data over NFS
Technique 40 Dev tools container
Summary

7 Configuration management: Getting your house in order
7.1 Configuration management and Dockerfiles
Technique 49 Creating reliable bespoke tools with ENTRYPOINT
Technique 50 Avoiding package drift by specifying versions
Technique 51 Replacing text with perl -p -i -e
Technique 52 Flattening images
Technique 53 Managing foreign packages with Alien
7.2 Traditional configuration management tools with Docker
Technique 54 Traditional: Using make with Docker
Technique 55 Building images with Chef Solo
7.3 Small is beautiful
Technique 56 Tricks for making an image smaller
Technique 57 Tiny Docker images with BusyBox and Alpine
Technique 58 The Go model of minimal containers
Technique 59 Using inotifywait to slim containers
Technique 60 Big can be beautiful
Summary

Part 3: Docker and DevOps
8 Continuous integration: Speeding up your development pipeline
8.1 Docker Hub automated builds
Technique 61 Using the Docker Hub workflow
8.2 More efficient builds
Technique 62 Speeding up I/O-intensive builds with eatmydata
Technique 63 Setting up a package cache for faster builds
Technique 64 Headless Chrome in a container
Technique 65 Running Selenium tests inside Docker
8.3 Containerizing your CI process
Technique 66 Running the Jenkins master within a Docker container
Technique 67 Containing a complex development environment
Technique 68 Scaling your CI with Jenkins’ Swarm plugin
Technique 69 Upgrading your containerized Jenkins server safely
Summary

9 Continuous delivery: A perfect fit for Docker principles
9.1 Interacting with other teams during the CD pipeline
Technique 70 The Docker contract: Reducing friction
9.2 Facilitating deployment of Docker images
Technique 71 Manually mirroring registry images
Technique 72 Delivering images over constrained connections
Technique 73 Sharing Docker objects as TAR files
9.3 Configuring your images for environments
Technique 74 Informing your containers with etcd
9.4 Upgrading running containers
Technique 75 Using confd to enable zero-downtime switchovers
Summary

10 Network simulation: Realistic environment testing without the pain
10.1 Container communication—​beyond manual linking
Technique 76 A simple Docker Compose cluster
Technique 77 A SQLite server using Docker Compose
10.2 Using Docker to simulate real-world networking
Technique 78 Simulating troublesome networks with Comcast
Technique 79 Simulating troublesome networks with Blockade
10.3 Docker and virtual networks
Technique 80 Creating another Docker virtual network
Technique 81 Setting up a substrate network with Weave
Summary

Part 4: Orchestration from a single machine to the cloud
11 A primer on container orchestration
11.1 Simple single-host Docker
Technique 82 Managing your host’s containers with systemd
Technique 83 Orchestrating the startup of your host’s containers
11.2 Manual Multi-host Docker
Technique 84 Manual multi-host Docker with Helios
11.3 Service discovery: What have we here?
Technique 85 Using Consul to discover services
Technique 86 Automatic service registration with Registrator
Summary

12 The data center as an OS with Docker
12.1 Multi-host Docker
Technique 87 A seamless Docker cluster with swarm mode
Technique 88 Using a Kubernetes cluster
Technique 89 Accessing the Kubernetes API from within a pod
Technique 90 Using OpenShift to run AWS APIs locally
Technique 91 Building a framework on Mesos
Technique 92 Micromanaging Mesos with Marathon
Summary

13 Docker platforms
13.1 Organizational choice factors
13.1.1 Time to market
13.1.2 Buy vs. build
13.1.3 Monolithic vs. piecemeal
13.1.4 Open source vs. licensed
13.1.5 Security stance
13.1.6 Consumer independence
13.1.7 Cloud strategy
13.1.8 Organizational structure
13.1.9 Multiple platforms?
13.1.10 Organizational factors conclusion
13.2 Areas to consider when adopting Docker
13.2.1 Security and control
13.2.2 Building and shipping images
13.2.3 Running containers
13.3 Vendors, organizations, and products
13.3.1 The Cloud Native Computing Foundation (CNCF)
13.3.2 Docker, Inc.
13.3.3 Google
13.3.4 Microsoft
13.3.5 Amazon
13.3.6 Red Hat
Summary

Part 5: Docker in production
14 Docker and security
14.1 Docker access and what it means
14.1.1 Do you care?
14.2 Security measures in Docker
Technique 93 Constraining capabilities
Technique 94 A “bad” Docker image to scan
14.3 Securing access to Docker
Technique 95 HTTP auth on your Docker instance
Technique 96 Securing your Docker API
14.4 Security from outside Docker
Technique 97 Reducing a container’s attack surface with DockerSlim
Technique 98 Removing secrets added during a build
Technique 99 OpenShift: An application platform as a service
Technique 100 Using security options
Summary

15 Plain sailing: Docker in production and operational considerations
15.1 Monitoring
Technique 101 Logging your containers to the host’s syslog
Technique 102 Logging your Docker logs output
Technique 103 Monitoring containers with cAdvisor
15.2 Resource control
Technique 104 Restricting the cores a container can execute on
Technique 105 Giving important containers more CPU
Technique 106 Limiting the memory usage of a container
15.3 Sysadmin use-cases for Docker
Technique 107 Using Docker to run cron jobs
Technique 108 The “save game” approach to backups
Summary

16 Docker in production: Dealing with challenges
16.1 Performance: You can’t ignore the tin
Technique 109 Accessing host resources from the container
Technique 110 Disabling the OOM killer
16.2 When containers leak—​debugging Docker
Technique 111 Debugging a container’s network with nsenter
Technique 112 Using tcpflow to debug in flight without reconfiguring
Technique 113 Debugging containers that fail on specific hosts
Technique 114 Extracting a file from an image
Summary
Appendixes

Appendix A: Installing and using Docker
The virtual machine approach
Docker client connected to an external Docker server
Native Docker client and virtual machine
Docker on Windows
Getting help

Appendix B: Docker configuration
Configuring Docker
Restarting Docker
Restarting with systemctl
Restarting with service

Appendix C: Vagrant
Setting up
GUIs
Memory

Erscheinungsdatum
Zusatzinfo Illustrations, unspecified
Verlagsort New York
Sprache englisch
Maße 190 x 240 mm
Gewicht 826 g
Themenwelt Mathematik / Informatik Informatik Netzwerke
Mathematik / Informatik Informatik Software Entwicklung
ISBN-10 1-61729-480-2 / 1617294802
ISBN-13 978-1-61729-480-8 / 9781617294808
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich
das umfassende Handbuch für den Einstieg in die Netzwerktechnik

von Martin Linten; Axel Schemberg; Kai Surendorf

Buch | Hardcover (2023)
Rheinwerk (Verlag)
29,90
das Praxisbuch für Admins und DevOps-Teams

von Michael Kofler

Buch | Hardcover (2023)
Rheinwerk (Verlag)
39,90