Docker Deep Dive

Book description

Start from scratch and develop the essential skills needed to create, deploy, and manage cloud-native applications using Docker

Key Features

  • Get a solid understanding of Docker and containers
  • Overcome common problems while containerizing an application
  • Master Docker commands needed for creating, deploying, and running applications

Book Description

Most applications, even the funky cloud-native microservices ones, need high-performance, production-grade infrastructure to run on. Having impeccable knowledge of Docker will help you to thrive in the modern cloud-first world. With this book, you'll gain the skills you need to work with Docker and its containers.

The book begins with an introduction to containers and explains its functionality and application in the real world. You'll then get an overview of VMware, Kubernetes, and Docker and learn to install Docker on Windows, Mac, and Linux. Once you've understood the Ops and Dev perspective of Docker, you'll be able to see the big picture and understand what Docker exactly does. The book then turns its attention to the more technical aspects, guiding your through practical exercises covering Docker engine, Docker images, and Docker containers. You'll learn techniques for containerizing an app, deploying apps with Docker Compose, and managing cloud-native applications with Swarm. You'll also build Docker networks and Docker overlay networks and handle applications that write persistent data. Finally, you'll deploy apps with Docker stacks and secure your Docker environment.

By the end of this book, you'll be well-versed in Docker and containers and have developed the skills to create, deploy, and run applications on the cloud.

What you will learn

  • Become familiar with the applications of Docker and containers
  • Discover how to pull images into Docker host's local registry
  • Find out how to containerize an app
  • Build and test a Docker overlay network in the swarm mode
  • Use Docker compose to deploy and manage multi-container applications
  • Securely share sensitive data with containers and Swarm services

Who this book is for

Whether you are a beginner or an experienced developer looking to utilize Docker to develop and operate cloud-native microservices apps, this book is for you. Anyone who wants to learn Docker orchestration, networking, imaging, and security will also find it useful. No prior knowledge of Docker is necessary.

Table of contents

  1. About the book
    1. 0: About the book
      1. Why should I read this book or care about Docker?
      2. What if I’m not a developer
      3. Should I buy the book if I’ve already watched your video training courses?
      4. How the book is organized
      5. Editions of the book
      6. Having problems getting the latest updates on your Kindle?
      7. The paperback edition
      8. Leave a review
  2. Part 1: The big picture stuff
    1. 1: Containers from 30,000 feet
      1. The bad old days
      2. Hello VMware!
      3. VMwarts
      4. Hello Containers!
      5. Linux containers
      6. Hello Docker!
      7. Windows containers
      8. Windows containers vs Linux containers
      9. What about Mac containers?
      10. What about Kubernetes
      11. Chapter Summary
    2. 2: Docker
      1. Docker - The TLDR
      2. Docker, Inc.
      3. The Docker technology
      4. The Open Container Initiative (OCI)
      5. Chapter summary
    3. 3: Installing Docker
      1. Docker Desktop
        1. Windows pre-reqs
        2. Installing Docker Desktop on Windows 10
        3. Installing Docker Desktop on Mac
      2. Installing Docker on Linux
      3. Installing Docker on Windows Server 2019
      4. Play with Docker
      5. Chapter Summary
    4. 4: The big picture
      1. The Ops Perspective
        1. Images
        2. Containers
        3. Attaching to running containers
      2. The Dev Perspective
      3. Chapter Summary
  3. Part 2: The technical stuff
    1. 5: The Docker Engine
      1. Docker Engine - The TLDR
      2. Docker Engine - The Deep Dive
        1. Getting rid of LXC
        2. Getting rid of the monolithic Docker daemon
        3. The influence of the Open Container Initiative (OCI)
        4. runc
        5. containerd
        6. Starting a new container (example)
        7. One huge benefit of this model
        8. What’s this shim all about?
        9. How it’s implemented on Linux
        10. What’s the point of the daemon
        11. Securing client and daemon communication
      3. Chapter summary
    2. 6: Images
      1. Docker images - The TLDR
      2. Docker images - The deep dive
        1. Images and containers
        2. Images are usually small
        3. Pulling images
        4. Image naming
        5. Image registries
        6. Image naming and tagging
        7. Images with multiple tags
        8. Filtering the output of docker image ls
        9. Searching Docker Hub from the CLI
        10. Images and layers
        11. Sharing image layers
        12. Pulling images by digest
        13. A little bit more about image hashes (digests)
        14. Multi-architecture images
        15. Deleting Images
      3. Images - The commands
      4. Chapter summary
    3. 7: Containers
      1. Docker containers - The TLDR
      2. Docker containers - The deep dive
        1. Containers vs VMs
        2. The VM tax
        3. Running containers
        4. Checking that Docker is running
        5. Starting a simple container
        6. Container processes
        7. Container lifecycle
        8. Stopping containers gracefully
        9. Self-healing containers with restart policies
        10. Web server example
        11. Inspecting containers
        12. Tidying up
      3. Containers - The commands
      4. Chapter summary
    4. 8: Containerizing an app
      1. Containerizing an app - The TLDR
      2. Containerizing an app - The deep dive
        1. Containerize a single-container app
        2. Moving to production with Multi-stage Builds
        3. A few best practices
      3. Containerizing an app - The commands
      4. Chapter summary
    5. 9: Deploying Apps with Docker Compose
      1. Deploying apps with Compose - The TLDR
      2. Deploying apps with Compose - The Deep Dive
        1. Compose background
        2. Installing Compose
        3. Compose files
        4. Deploying an app with Compose
        5. Managing an app with Compose
      3. Deploying apps with Compose - The commands
      4. Chapter Summary
    6. 10: Docker Swarm
      1. Docker Swarm - The TLDR
      2. Docker Swarm - The Deep Dive
        1. Swarm primer
        2. Build a secure Swarm cluster
        3. Swarm manager high availability (HA)
        4. Swarm services
        5. Viewing and inspecting services
        6. Replicated vs global services
        7. Scaling a service
        8. Removing a service
        9. Rolling updates
        10. Troubleshooting
        11. Backing up Swarm
      3. Docker Swarm - The Commands
      4. Chapter summary
    7. 11: Docker Networking
      1. Docker Networking - The TLDR
      2. Docker Networking - The Deep Dive
        1. The theory
        2. Single-host bridge networks
        3. Multi-host overlay networks
        4. Connecting to existing networks
        5. Service discovery
        6. Ingress load balancing
      3. Docker Networking - The Commands
      4. Chapter Summary
    8. 12: Docker overlay networking
      1. Docker overlay networking - The TLDR
      2. Docker overlay networking - The deep dive
        1. Build and test a Docker overlay network in Swarm mode
        2. Test the overlay network
        3. The theory of how it all works
      3. Docker overlay networking - The commands
      4. Chapter Summary
    9. 13: Volumes and persistent data
      1. Volumes and persistent data - The TLDR
      2. Volumes and persistent data - The Deep Dive
        1. Containers and non-persistent data
        2. Containers and persistent data
        3. Demonstrating volumes with containers and services
        4. Sharing storage across cluster nodes
      3. Volumes and persistent data - The Commands
      4. Chapter Summary
    10. 14: Deploying apps with Docker Stacks
      1. Deploying apps with Docker Stacks - The TLDR
      2. Deploying apps with Docker Stacks - The Deep Dive
        1. Overview of the sample app
        2. Looking closer at the stack file
        3. Deploying the app
        4. Managing the app
      3. Deploying apps with Docker Stacks - The Commands
      4. Chapter Summary
    11. 15: Security in Docker
      1. Security in Docker - The TLDR
      2. Security in Docker - The deep dive
        1. Linux security technologies
        2. Docker platform security technologies
        3. Docker Secrets
      3. Chapter Summary
    12. 16: What next
      1. Practice makes perfect
      2. Video training
      3. Get involved with the community
      4. Kubernetes
      5. Feedback and connecting

Product information

  • Title: Docker Deep Dive
  • Author(s): Nigel Poulton
  • Release date: October 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781800565135