Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Docker —— 从入门到实践
## 【One-Line Pitch】
A practical, hands-on guide to Docker for beginners and intermediate users, covering everything from installation and image building to container orchestration and real-world deployment scenarios. Ideal for developers, DevOps engineers, and IT professionals who want to master containerization without getting lost in theory.
## 【Book Arc】
- **Opening (~0%–9%)**: Introduces Docker's value proposition and walks through installation on major platforms (Ubuntu, Debian, Raspberry Pi, macOS), including mirror acceleration for users in China. Establishes the core mental model: Docker images are layered root filesystems, not monolithic packages.
- **Early (~17%–30%)**: Dives into image management fundamentals—understanding layered storage, deleting images (Untagged vs. Deleted), and the dangers of `docker commit`. Transitions to proper image building with Dockerfiles, covering build context, CMD vs. ENTRYPOINT, ARG, HEALTHCHECK, and multi-stage builds.
- **Middle (~35%–48%)**: Shifts to container operations (exec, lifecycle management) and networking—default bridge, custom bridges, port mapping, and inter-container communication. Introduces Docker Hub workflows including automated builds and private registry setup with TLS.
- **Middle (~48%–52%)**: Covers Docker Compose in depth—the tool for defining and running multi-container applications. Explains services vs. projects, template file syntax, environment variable substitution, and common commands for lifecycle management.
- **Late (beyond ~52%)**: Presents practical scenarios like running WordPress with MySQL via Compose, plus machine drivers for cloud providers (AWS, Azure, DigitalOcean, etc.), demonstrating real-world deployment patterns.
## 【Key Takeaways】
- **Images are layered, immutable filesystems** (Early): Each layer builds on the previous one; deleting a file only marks it deleted in the current layer. This explains why images can be large, why deletion behaves unexpectedly, and why you should keep each layer clean during builds.
- **`docker commit` is a trap for beginners** (Early): While it creates new images by adding layers, it's non-reproducible and obscures how the image was built. Use Dockerfiles instead—they document the build process and enable version control.
- **Build context matters more than Dockerfile location** (Early): `COPY` paths are relative to the context directory, not the Dockerfile's location. Putting the Dockerfile at the filesystem root to "fix" path issues will make `docker build` package the entire disk—a common and costly mistake.
- **Containers are processes, not virtual machines** (Early): Applications should run in the foreground; there's no concept of background services. Writing `CMD service nginx start` is wrong—use `CMD ["nginx", "-g", "daemon off;"]` instead.
- **Multi-stage builds solve the bloat problem** (Middle): By separating build and runtime stages in a single Dockerfile, you can compile with full toolchains (e.g., Go) and ship only the minimal runtime artifacts—no more juggling multiple Dockerfiles and scripts.
- **Compose turns multi-container complexity into a YAML file** (Middle): Define services (containers) and projects (complete business units) in `docker-compose.yml`. Environment variables from the shell or `.env` files make configurations flexible and reusable.
- **Health checks are built-in and essential** (Early): `HEALTHCHECK` with interval/timeout/retries parameters lets Docker monitor container liveness. Status transitions from `starting` to `healthy` or `unhealthy` are visible via `docker ps` and inspectable for debugging.
## 【Reading Tips】
- **Skim the installation chapters** (~0%–9%) if you already have Docker running—just note the mirror acceleration section if you're in China. The real value starts with image concepts.
- **Deep-read the Dockerfile chapters** (~22%–30%): This is where most beginners make mistakes. Pay special attention to build context, CMD vs. ENTRYPOINT, and multi-stage builds—these will save you hours of debugging.
- **Treat the Compose section** (~48%–52%) as a reference: The template file syntax is dense; skim the command list, then return when you need to write your own `docker-compose.yml`. The WordPress example is worth following step-by-step.
- **Watch for version-specific advice**: The book targets Docker CE v17.x (2017-era). Commands like `docker image ls` vs. `docker images` may differ in newer versions—check your local `docker --help` when in doubt.
- **Skip the advanced security/implementation chapters** (14–15) on first read unless you're planning production deployments—they're valuable but not essential for daily usage.
## 【Coverage Limits】
This guide covers the first ~52% of the book (fundamentals through Compose). The excerpts do not cover later chapters on Kubernetes, Mesos, Etcd, CoreOS, container clouds, or Docker security internals—those topics are beyond this guide's scope.
##
config files cluster-info Display cluster info api-versions Print available API versions. version Print the client and server version information. help Help...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Docker —— 从入门到实践 (yeasy [yeasy])(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Docker —— 从入门到实践 (yeasy [yeasy])(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Docker —— 从入门到实践 (yeasy [yeasy])(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment