Statistics
6
Views
0
Downloads
0
Donations
Support
Share
Uploader

高宏飞

Shared on 2026-02-25

AuthorNigel Poulton

For nearly a decade, Docker Deep Dive has been the go-to guide for developers and IT professionals looking to master Docker. With more reviews than any other Docker book and a track record as the most popular Docker book on the market, this Amazon bestseller is your ultimate resource for mastering Docker. What's New in the 2025 Edition? This latest edition is fully updated with cutting-edge advancements in the Docker ecosystem, including:- Wasm containers (WebAssembly) - The future of fast, portable, high-performance workloads - Multi-container LLM chatbot apps - Deploy and manage AI-powered chatbots with Docker Compose & Ollama - Professional development environment, app templates, debugging, and vulnerability scanning, with Docker Desktop, Docker Init, Docker Debug, and Docker Scout The demand for Docker expertise is skyrocketing as organizations build cloud-native and AI-powered applications. Whether you're deploying apps locally or in the cloud, this book equips you with everything you need to succeed in the real world. What You'll Learn: - Set up a professional Docker development environment - for free - Create and manage containerized applications from scratch - Build and share container images using Docker Hub - Deploy and orchestrate multi-container apps with Docker Compose & Swarm - Create Wasm apps, build them as Docker containers, and run them with Docker - Deploy and manage LLM chatbots with Docker Compose - Create production-ready images that run on x86 and ARM - Easy and powerful debugging with Docker Debug - Vulnerability scanning with Docker Scout - Leverage the latest Docker technologies, including Docker Desktop, Docker Debug, Docker Init, Docker Scout, and more Whether you're a beginner looking for a step-by-step guide or an experienced developer who wants to stay ahead of the curve, Docker Deep Dive (2025 Edition) is the ultimate resource for mastering Docker. File Info: High quality PDF directly from leanpub.com.

Tags
No tags
ISBN: 191658537X
Publisher: Leanpub
Publish Year: 2025
Language: 英文
File Format: PDF
File Size: 10.9 MB
Support Statistics
¥.00 · 0times
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

(This page has no text content)
Docker Deep Dive Zero to Docker in a single book! Nigel Poulton This book is available at https://leanpub.com/dockerdeepdive This version was published on 2025-05-12 ISBN 9781916585133 This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do. © 2016 - 2025 Nigel Poulton
Huge thanks to my wife and kids for putting up with a geek in the house who genuinely thinks he’s a bunch of software running inside of a container on top of midrange biological hardware. It can’t be easy living with me! Massive thanks as well to everyone who watches my Pluralsight videos. I love connecting with you and really appreciate all the feedback I’ve gotten over the years. This was one of the major reasons I decided to write this book! I hope it’ll be an amazing tool to help you drive your careers even further forward.
Contents About this edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 About the author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 0: About the book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Part 1: The big picture stuff . . . . . . . . . . . . . . . . . . . . . 6 1: Containers from 30,000 feet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 The bad old days . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Hello VMware! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 VMwarts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Hello Containers! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Linux containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Hello Docker! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Docker and Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 What about Wasm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Docker and AI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 What about Kubernetes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2: Docker and container-related standards and projects . . . . . . . . . . . . . . . . 13 Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Container-related standards and projects . . . . . . . . . . . . . . . . . . . . . . . . 15 3: Getting Docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Docker Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Installing Docker with Multipass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Installing Docker on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4: The big picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 The Ops Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 The Dev Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
CONTENTS Part 2: The technical stuff . . . . . . . . . . . . . . . . . . . . . . . 35 5: The Docker Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Docker Engine – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 The Docker Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 The influence of the Open Container Initiative (OCI) . . . . . . . . . . . . . . . . . 39 runc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 containerd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Starting a new container (example) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 What’s the shim all about? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 How it’s implemented on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6: Working with Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Docker images – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Intro to images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Pulling images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Image registries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Image naming and tagging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Images and layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Pulling images by digest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Multi-architecture images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Vulnerability scanning with Docker Scout . . . . . . . . . . . . . . . . . . . . . . . . 66 Deleting Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Images – The commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 7: Working with containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Containers – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Containers vs VMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Images and Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Check Docker is running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Starting a container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 How containers start apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Connecting to a running container . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Inspecting container processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 The docker inspect command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Writing data to a container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Stopping, restarting, and deleting a container . . . . . . . . . . . . . . . . . . . . . . 85 Killing a container’s main process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Debugging slim images and containers with Docker Debug . . . . . . . . . . . . . 89 Self-healing containers with restart policies . . . . . . . . . . . . . . . . . . . . . . . 94 Containers – The commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 8: Containerizing an app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
CONTENTS Containerizing an app – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Containerize a single-container app . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Moving to production with multi-stage builds . . . . . . . . . . . . . . . . . . . . . 111 Buildx, BuildKit, drivers, and Build Cloud . . . . . . . . . . . . . . . . . . . . . . . . 116 Multi-architecture builds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 A few good practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Containerizing an app – The commands . . . . . . . . . . . . . . . . . . . . . . . . . 124 9: Multi-container apps with Compose . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Docker Compose – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Compose background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Installing Compose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 The sample app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Compose files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Deploying apps with Compose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Managing apps with Compose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Deploying apps with Compose – The commands . . . . . . . . . . . . . . . . . . . . 139 10: Docker and AI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Docker Model Runner background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Docker Model Runner Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Installing Docker Model Runner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Explore Docker Model Runner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Use Docker Model Runner with Compose . . . . . . . . . . . . . . . . . . . . . . . . 152 Use Docker Model Runner with Open WebUI . . . . . . . . . . . . . . . . . . . . . 155 Running models in containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Docker Model Runner – The commands . . . . . . . . . . . . . . . . . . . . . . . . . 162 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 11: Docker andWasm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Pre-reqs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Intro to Wasm and Wasm containers . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Write a Wasm app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Containerize a Wasm app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Run a Wasm container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Clean up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Chapter summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 12: Docker Swarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Swarm primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Build a swarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Deploy Swarm app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Docker Swarm – The Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
CONTENTS 13: Docker Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Docker Networking – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Docker networking theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Single-host bridge networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 External access via port mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Docker Networking – The Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 214 14: Docker overlay networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Docker overlay networking – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . 216 Docker overlay networking history . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Building and testing Docker overlay networks . . . . . . . . . . . . . . . . . . . . . 217 Overlay networks explained . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Docker overlay networking – The commands . . . . . . . . . . . . . . . . . . . . . . 229 15: Volumes and persistent data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 Volumes and persistent data – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . 231 Containers without volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Containers with volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Volumes and persistent data – The Commands . . . . . . . . . . . . . . . . . . . . . 240 16: Docker security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Docker security – The TLDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Kernel Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Control Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Mandatory Access Control systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 seccomp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 Docker security technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Swarm security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Docker Scout and vulnerability scanning . . . . . . . . . . . . . . . . . . . . . . . . 256 Signing and verifying images with Docker Content Trust . . . . . . . . . . . . . . . 258 Docker Secrets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 What next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
CONTENTS 1 About this edition This edition was published inMay 2025 and is up to date with the latest industry trends and the latest enhancements to Docker. Major changes include: • Brand new Docker Model Runner chapter with full AI LLM project • Updates to BuildKit, buildx, and the new Docker Build Cloud • Updates to Docker Debug content • Updates to Wasm content • Streamlined Swarm chapter Enjoy the book, and get ready to master containers! &copy 2025 Nigel Poulton Ltd.
About the author Nigel is a technology geek with a passion for learning new technologies and making them easier for others to learn. He’s the author of best-selling books on Docker and Kubernetes, as is the author of AI Explained: Facts, Fiction, and Future, a brutal read into the impacts of AI on society and the future of humanity. Nigel is a Docker Captain and has held senior technology roles at large and small enterprises. In his free time, he listens to audiobooks and coaches youth football (soccer). He wishes he lived in the future and could understand the mysteries of life and the universe. He’s passionate about learning, cars, and football (soccer). He lives in England with his fabulous wife and three children.
0: About the book ThisMay 2025 edition gets you up to speed with Docker and containers fast, no prior experience necessary. It has a brand-new chapter covering the latest and greatest Docker Model Runner content for running local LLMs through Docker! Why should I read this book or care about Docker? Docker has already changed how we build, share, and run applications, and it’s now playing a major role in emerging technologies such as Wasm and AI. So, if you want the best jobs working with the best technologies, you need a strong Docker skillset. How I’ve organized the book I’ve divided the book into two main sections: 1. The big picture stuff 2. The technical stuff The big picture stuff gets you up to speed with the basics, such as what Docker is, why we use containers, and fundamental jargon such as cloud-native, microservices, and orchestration. The technical stuff section covers everything you need to know about images, containers, multi-container microservices apps, orchestration, and the increasingly important topics of WebAssembly, running local AI models, vulnerability scanning, debugging containers, and more.
0: About the book 4 Chapter breakdown • Chapter 1: Summarizes the history and future of Docker and containers • Chapter 2: Explains the most important container-related standards and projects • Chapter 3: Shows you a few ways to get Docker • Chapter 4:Walks you through deploying your first container • Chapter 5: Deep dive into the Docker Engine architecture • Chapter 6: Deep dive into images and image management • Chapter 7: Deep dive into containers and container management • Chapter 8: Deep dive into containerizing applications • Chapter 9:Walks you through deploying and managing a multi-container AI chatbot app with Docker Compose • Chapter 10: Dives into the exciting new world of running local AI models with Docker Model Runner • Chapter 11:Walks you through building, containerizing, and running a Wasm app with Docker • Chapter 12:Walks you through building a swarm cluster and deploying apps to it • Chapter 13: Deep dive into Docker networking • Chapter 14:Walks you through building and working with overlay networks • Chapter 15: Introduces you to persistent and non-persistent data in Docker • Chapter 16: Covers all the major Linux and Docker security technologies Editions and updates Docker, AI, and the cloud-native ecosystem are evolving fast, and 2-3-year-old books are dangerously outdated. As a result, I’m committed to updating this book at least once per year. If that sounds excessive, welcome to the new normal. For example, I released a big update in January 2025. Then, less than three months later, I was writing a full new chapter on Docker Model Runner for this May 2025 edition! This is hard work, but I’m committed to keeping this the best Docker book in the world. The book is available in hardback, paperback, and e-book on all good book publishing platforms.
0: About the book 5 Kindle updates Unfortunately, Kindle readers cannot get updates. I have absolutely no control over this and was devastated when this change happened. Some people have successfully contacted Kindle Support and had the support team delete the old copy and push the new edition. However, this doesn’t always work. Please contact the Kindle Support team for updates, but if they can’t help, feel free to ping me at the book’s email address. Feedback If you like the book and it helps your career, share the love by recommending it to a friend and leaving a review on Amazon or Goodreads. If you spot a typo or want to make a recommendation, drop me a quick email at ddd@nigelpoulton.com and I’ll do my best to respond. That’s everything. Let’s get rocking with Docker!
Part 1: The big picture stuff
1: Containers from 30,000 feet Containers have taken over the world! In this chapter, you’ll learn why we have containers, what they do for us, and where we can use them. The bad old days Applications are the powerhouse of every modern business. When applications break, businesses break. Most applications run on servers, and in the past, we were limited to running one application per server. As a result, the story went something like this: Every time a business needed a new application, it had to buy a new server. Unfor- tunately, we weren’t very good at modeling the performance requirements of new applications, and we had to guess. This resulted in businesses buying bigger, faster, and more expensive servers than necessary. After all, nobody wanted underpowered servers incapable of handling the app, resulting in unhappy customers and lost revenue. As a result, we ended up with racks and racks of overpowered servers operating as low as 5-10% of their potential capacity. This was a tragic waste of company capital and environmental resources. Hello VMware! Amid all this, VMware, Inc. gave the world a gift — the virtual machine (VM)— a technology that allowed us to run multiple business applications on a single server safely. It was a game-changer. Businesses could run new apps on the spare capacity of existing servers, spawning a golden age of maximizing the value of existing assets. VMwarts But, and there’s always a but! As great as VMs are, they’re far from perfect.
1: Containers from 30,000 feet 8 For example, every VM needs its own dedicated operating system (OS). Unfortunately, this has several drawbacks, including: • Every OS consumes CPU, RAM, and other resources we’d rather use on applica- tions • Every VM and OS needs patching • Every VM and OS needs monitoring VMs are also slow to boot and not very portable. Hello Containers! While most of us were reaping the benefits of VMs, web scalers like Google had already moved on from VMs and were using containers. A feature of the container model is that every container shares the OS of the host it’s running on. This means a single host can run more containers than VMs. For example, a host that can run 10 VMs might be able to run 50 containers, making containers far more efficient than VMs. Containers are also faster and more portable than VMs. Linux containers Modern containers started in the Linux world and are the product of incredible work from many people over many years. For example, Google contributed many container- related technologies to the Linux kernel. It’s thanks to many contributions like these that we have containers today. Some of the major technologies underpinning modern containers include kernel namespaces, control groups (cgroups), and capabilities. However, despite all this great work, containers were incredibly complicated, and it wasn’t until Docker came along that they became accessible to the masses. Note: I know that many container-like technologies pre-date Docker and modern containers. However, none of them changed the world the way Docker has.
1: Containers from 30,000 feet 9 Hello Docker! Docker was the magic that made Linux containers easy and brought them to the masses. We’ll talk a lot more about Docker in the next chapter. Docker and Windows Microsoft worked hard to bring Docker and container technologies to the Windows platform. At the time of writing, Windows desktop and server platforms support both of the following: • Windows containers • Linux containers Windows containers run Windows apps and require a host system with a Windows kernel. Windows 10, Windows 11, and all modern versions of Windows Server natively support Windows containers. Windows systems can also run Linux containers via theWSL 2 (Windows Subsystem for Linux) subsystem. This means Windows 10 and Windows 11 are great platforms for developing and testing Windows and Linux containers. However, despite all the work developingWindows containers, almost all containers are Linux containers. This is because Linux containers are smaller and faster, and more tooling exists for Linux. All of the examples in this edition of the book are Linux containers. Windows containers vs Linux containers It’s vital to understand that containers share the kernel of the host they’re running on. This means containerized Windows apps need a host with a Windows kernel, whereas containerized Linux apps need a host with a Linux kernel. However, as mentioned, you can run Linux containers on Windows systems that have the WSL 2 backend installed. Terminology: A containerized app is an application running as a container. We’ll cover this in a lot of detail later.
1: Containers from 30,000 feet 10 What about Mac containers? There is no such thing as Mac containers. However, Macs are great platforms for working with containers, and I do all of my daily work with containers on a Mac. The most popular way of working with containers on a Mac is Docker Desktop. It works by running Docker inside a lightweight Linux VM on your Mac. Other tools, such as Podman and Rancher Desktop, are also great for working with containers on a Mac. What about Wasm Wasm (WebAssembly) is a modern binary instruction set that builds applications that are smaller, faster, more secure, and more portable than containers. You write your app in your favorite language and compile it as a Wasm binary that will run anywhere you have a Wasm runtime. However, Wasm apps have many limitations, and we’re still developing many of the standards. As a result, containers remain the dominant model for cloud-native applications. The container ecosystem is also much richer and more mature than the Wasm ecosys- tem. As you’ll see in the Wasm chapter, Docker and the container ecosystem are adapting to work with Wasm apps, and you should expect a future where VMs, containers, and Wasm apps run side-by-side in most clouds and applications. This book is up-to-date with the latest Wasm and container developments. Docker and AI Developers and organizations are using more and more AI apps, and Docker is regularly ranked as the No. 1 most-desired and No. 1 most-used developer tool (Stack Overflow Annual Developer Survey). Unfortunately, exposing GPUs and other AI acceleration hardware to apps running inside containers is very hard. This is because they all have their own drivers and SDKs, and it’s too much work for the industry to make them all work with containers. As a result, Docker has released Docker Model Runner as a way of running local LLMs outside of containers so they have direct access to the host’s hardware. Chapter 10 is dedicated to running local AI models with Docker Model Runner, and it’s very exciting.
1: Containers from 30,000 feet 11 What about Kubernetes Kubernetes is the industry standard platform for deploying and managing containerized apps. Older versions of Kubernetes used Docker to start and stop containers. However, newer versions use containerd, which is a stripped-down version of Docker optimized for use by Kubernetes and other platforms. The important thing to know is that all Docker containers work on Kubernetes. Check out these books if you need to learn Kubernetes: • Quick Start Kubernetes: This is ∼100 pages and will get you up-to-speed with Kubernetes in a single day! • The Kubernetes Book. This is the ultimate book for mastering Kubernetes. I update both books annually to ensure they’re up-to-date with the latest and greatest developments in the cloud native ecosystem. Chapter Summary We used to live in a world where every business application needed a dedicated, over- powered server. VMware came along and allowed us to run multiple applications on new and existing servers. However, following the success of VMware and hypervisors, a newer, more efficient, and portable virtualization technology called containers came
1: Containers from 30,000 feet 12 along. However, containers were complex and hard to implement until Docker came along and made them easy. Wasm and AI are powering new innovations, and the Docker ecosystem is evolving to work with both. The book has entire chapters dedicated to working with AI apps and Wasm apps on Docker.
2: Docker and container-related standards and projects This chapter introduces you to Docker and some of the most important standards and projects shaping the container ecosystem. The goal is to lay some foundations that we’ll build on in later chapters. This chapter has two main parts: • Docker • Container-related standards and projects Docker Docker is at the heart of the container ecosystem. However, the term Docker can mean two things: 1. The Docker platform 2. Docker, Inc. The Docker platform is a neatly packaged collection of technologies for creating, manag- ing, and orchestrating containers. Docker, Inc. is the company that created the Docker platform and continues to be the driving force behind developing new features. Let’s dive a bit deeper. Docker, Inc. Docker, Inc. is a technology company based out of Palo Alto and founded by French- born American developer and entrepreneur Solomon Hykes. Solomon is no longer at the company. The company started as a platform as a service (PaaS) provider called dotCloud. Behind the scenes, dotCloud delivered its services on top of containers and had an in-house tool to help them deploy and manage those containers. They called this in-house tool Docker. The word Docker is a British expression short for dock worker referring to someone who loads and unloads cargo from ships.