Unlock the full potential of the Docker containerization platform with this practical guide
Key Features
- Explore tools such as Docker Engine, Machine, Compose, and Swarm
- Discover how you can integrate Docker into your everyday workflows
- Get well-versed with Kubernetes options such as Minikube, Kind, and MicroK8s
Book Description
Docker has been a game changer when it comes to how modern applications are deployed and created. It has now grown into a key driver of innovation beyond system administration, with a significant impact on the world of web development. Mastering Docker shows you how you can ensure that you're keeping up with the innovations it's driving and be sure you're using it to its full potential. This fourth edition not only demonstrates how to use Docker more effectively but also helps you rethink and reimagine what you can achieve with it.
You'll start by building, managing, and storing images along with exploring best practices for working with Docker confidently. Once you've got to grips with Docker security, the book covers essential concepts for extending and integrating Docker in new and innovative ways. You'll also learn how to take control of your containers efficiently using Docker Compose, Docker Swarm, and Kubernetes.
By the end of this Docker book, you'll have a broad yet detailed sense of what's possible with Docker and how seamlessly it fits in with a range of other platforms and tools.
What you will learn
- Get to grips with essential Docker components and concepts
- Discover the best ways to build, store, and distribute container images
- Understand how Docker can fit into your development workflow
- Secure your containers and files with Docker's security features
- Explore first-party and third-party cluster tools and plugins
- Launch and manage your Kubernetes clusters in major public clouds
Who this book is for
If you are a software architect, DevOps engineer, sysadmin, or IT professional looking to leverage Docker's extensive features for innovating any process from system administration to web development, Mastering Docker will show you how you can use it to its full potential. A basic understanding of containerization and prior Docker experience is necessary.
Table of Contents
- Docker Overview
- Building Container Images
- Storing & Distributing Images
- Managaing Containers
- Launching Multiple Containers using Docker Compose
- Using Docker Machine, Vagrant and Multipass
- Moving from Linux to Windows Containers
- Clustering with Docker Swarm
- Portainer - A GUI for Docker
- Running Docker in Public Clouds
- Clustering with Docker & Kubernetes
- Discovering more Kubernetes options
- Running Kubernetes in Public Clouds
- Securing your Docker Environment
- Docker Workflows
- Next Steps with Docker
Author(s): Russ McKendrick
Edition: 4
Publisher: Packt Publishing
Year: 2020
Language: English
Commentary: True PDF
Pages: 568
Cover
Copyright
About PACKT
Contributors
Table of Contents
Preface
Section 1 – Getting Up and Running with Docker
Chapter 1: Docker Overview
Technical requirements
Understanding Docker
Developers
Operators
Enterprise
Docker installation
Installing Docker on Linux
Installing Docker on macOS
Installing Docker on Windows 10 Professional
Older operating systems
Using Docker commands
Docker and the container ecosystem
Open source projects
Docker, Inc.
Docker CE and Docker EE
Summary
Questions
Further reading
Chapter 2: Building Container Images
Technical requirements
Introducing Dockerfiles
Reviewing Dockerfiles in depth
FROM
LABEL
RUN
COPY and ADD
Other Dockerfile instructions
Dockerfiles – best practices
Building Docker images
Using a Dockerfile
Using an existing container
Using ENVs
Using multi-stage builds
Summary
Questions
Further reading
Chapter 3: Storing and Distributing Images
Technical requirements
Understanding Docker Hub
The Docker Hub Dashboard
Creating an automated build
Setting up your code
Setting up Docker Hub
Pushing your own image
Docker Certified Images and Verified Publishers
Deploying your own Docker Registry
An overview of Docker Registry
Deploying your own registry
Docker Trusted Registry
Reviewing third-party registries
GitHub Packages and Actions
Azure Container Registry
Summary
Questions
Further reading
Chapter 4: Managing Containers
Technical requirements
Understanding Docker container commands
The basics
Interacting with your containers
logs
top
stats
Resource limits
Container states and miscellaneous commands
Docker networking and volumes
Docker volumes
Docker Desktop Dashboard
Summary
Questions
Further reading
Chapter 5: Docker Compose
Technical requirements
Exploring the basics of Docker Compose
Orchard Laboratories
Making our first Docker Compose application
Docker Compose YAML file
The Moby counter application
Example voting application
Exploring Docker Compose commands
config
pull, build, and create
start, stop, restart, pause, and unpause
scale
Using Docker App
Defining the application
Validating and inspecting the application
Launching the app
Pushing to Docker Hub
Installing from Docker Hub
Questions
Further reading
Chapter 6: Docker Machine, Vagrant, and Multipass
Technical requirements
An introduction to Docker Machine
Installing Docker Machine using Docker Toolbox
Installing Docker Machine using the command line
Deploying local Docker hosts with Docker Machine
Launching Docker hosts in the cloud using Docker Machine
Docker Machine summary
Introducing and using Vagrant
Introducing and using Multipass
Summary
Questions
Further reading
Section 2 – Clusters and Clouds
Chapter 7: Moving from Linux to Windows Containers
Technical requirements
An introduction to Windows containers
So, what are Windows containers?
Setting up your Docker host for Windows containers
Enabling Windows Container Support on Windows 10 Professional
Up and running on MacOS and Linux
Running Windows containers
A Windows container Dockerfile
Windows containers and Docker Compose
Summary
Questions
Further reading
Chapter 8: Clustering with Docker Swarm
Technical requirements
Introducing Docker Swarm
Roles within a Docker Swarm cluster
Creating and managing a Swarm
Creating the cluster hosts
Adding a Swarm manager to the cluster
Joining Swarm workers to the cluster
Listing nodes
Managing a cluster
Finding information on the cluster
Promoting a worker node
Demoting a manager node
Draining a node
Docker Swarm services and stacks
Services
Stacks
Deleting a Swarm cluster
Load balancing, overlays, and scheduling
Ingress load balancing
Network overlays
Scheduling
Summary
Questions
Further reading
Chapter 9: Portainer – A GUI
for Docker
Technical requirements
The road to Portainer
Getting Portainer up and running
Using Portainer
The dashboard
Application templates
Containers
Portainer and Docker Swarm
Creating the Swarm
The Portainer service
Swarm differences
Summary
Questions
Further reading
Chapter 10: Running Docker in Public Clouds
Technical requirements
Amazon Web Services
Amazon ECS – EC2-backed
Amazon ECS – AWS Fargate backed
Summing up AWS
Microsoft Azure
Azure web app for containers
Azure container instances
Summing up Microsoft Azure
Google Cloud
Google Cloud Run
Summing up Google Cloud
Summary
Questions
Further reading
Chapter 11: Docker and Kubernetes
Technical requirements
An introduction to Kubernetes
A brief history of containers at Google
An overview of Kubernetes
How does Docker fit in with Kubernetes?
Using Kubernetes and Docker Desktop
Kubernetes and other Docker tools
Summary
Questions
Further reading
Chapter 12: Discovering other Kubernetes options
Technical requirements
Deploying Kubernetes using Minikube
Installing Minikube
Interacting with your Kubernetes cluster node
Managing Minikube
Minikube summary
Deploying Kubernetes using kind
Installing Kind
Launching a Kind cluster
Interacting with your Kubernetes cluster node
Kind summary
Deploying Kubernetes using MicroK8s
Installing MicroK8s
Interacting with your Kubernetes cluster node
MicroK8s summary
Deploying Kubernetes using K3s
Installing K3s
Interacting with your Kubernetes cluster nodes
One more thing – K3d
K3s summary
Summary
Questions
Further reading
Chapter 13: Running Kubernetes in Public Clouds
Technical requirements
Microsoft Azure Kubernetes Service (AKS)
Launching a cluster using the web portal
Launching a cluster using the command-line tools
Launching an application
Cluster information
Microsoft Azure Kubernetes Service summary
Google Kubernetes Engine (GKE)
Launching a cluster using the web portal
Launching a cluster using the command-line tools
Launching an application
Cluster information
Google Kubernetes Engine summary
Amazon Elastic Kubernetes Service (EKS)
Launching a cluster using the command-line tools
Launching an application
Cluster information
Amazon Elastic Kubernetes Service summary
DigitalOcean Kubernetes
Summary
Questions
Further reading
Section 3 – Best Practices
Chapter 14: Docker Security
Technical requirements
Container considerations
The advantages
Your Docker hosts
Image trust
Docker commands
The Docker Run command
The docker diff command
Best practices
Docker best practices
The Center for Internet Security benchmark
The Docker Bench Security application
Third-party security services
Quay
Clair
Anchore
Summary
Questions
Further reading
Chapter 15: Docker Workflows
Technical requirements
Docker for development
Docker and Azure DevOps
Monitoring Docker and Kubernetes
What does production look like?
Your Docker hosts
Clustering
Image registries
Summary
Questions
Further reading
Chapter 16: Next Steps with Docker
The Moby Project
Contributing to Docker
Contributing to the code
Offering Docker support
Other contributions
The Cloud Native Computing Foundation
Graduated projects
Incubating projects
The CNCF landscape
Summary
Assessments
Chapter 1, Docker Overview
Chapter 2, Building Container Images
Chapter 3, Storing and Distributing Images
Chapter 4, Managing Containers
Chapter 5, Docker Compose
Chapter 6, Docker Machine, Vagrant, and Multipass
Chapter 7, Moving from Linux to Windows Containers
Chapter 8, Clustering with Docker Swarm
Chapter 9, Portainer – a GUI for Docker
Chapter 10, Running Docker in Public Clouds
Chapter 11, Docker and Kubernetes
Chapter 12, Discovering other Kubernetes options
Chapter 13, Running Kubernetes in Public Clouds
Chapter 14, Docker Security
Chapter 15, Docker Workflows
Other Books You May Enjoy
Leave a review - let other readers know what you think
Index