diff --git a/01_introduction/summary.md b/01_introduction/summary.md index e4a2741..74c761f 100644 --- a/01_introduction/summary.md +++ b/01_introduction/summary.md @@ -6,3 +6,6 @@ - Docker 推动了容器技术的标准化 (OCI) 和生态发展 Docker 的核心价值可以用一句话概括:**让应用的开发、测试、部署保持一致,同时极大提高资源利用效率。** 笔者认为,对于现代软件开发者来说,Docker 已经不是 “要不要学” 的问题,而是 **必备技能**。无论你是前端、后端、运维还是全栈开发者,掌握 Docker 都能让你的工作更高效。 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/02_basic_concept/summary.md b/02_basic_concept/summary.md index 3ad3c15..a0a8a0a 100644 --- a/02_basic_concept/summary.md +++ b/02_basic_concept/summary.md @@ -35,3 +35,6 @@ - [私有仓库](../06_repository/6.2_registry.md):搭建私有 Registry - [私有仓库高级配置](../06_repository/6.3_registry_auth.md):认证、TLS 配置 - [镜像加速器](../03_install/3.9_mirror.md):配置镜像加速 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/03_install/summary.md b/03_install/summary.md index 93bf5d8..429668a 100644 --- a/03_install/summary.md +++ b/03_install/summary.md @@ -25,3 +25,6 @@ $ docker run --rm hello-world - [镜像加速器](3.9_mirror.md):解决国内拉取镜像慢的问题 - [开启实验特性](3.10_experimental.md):使用最新功能 - [Docker Hub](../06_repository/6.1_dockerhub.md):官方镜像仓库 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/04_image/summary.md b/04_image/summary.md index 5f5846b..f7bd889 100644 --- a/04_image/summary.md +++ b/04_image/summary.md @@ -31,3 +31,6 @@ - [镜像](../02_basic_concept/2.1_image.md):理解镜像概念 - [删除容器](../05_container/5.6_rm.md):清理容器 - [数据卷](../08_data/8.1_volume.md):清理数据卷 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/05_container/summary.md b/05_container/summary.md index dd96863..f6fbf47 100644 --- a/05_container/summary.md +++ b/05_container/summary.md @@ -28,3 +28,6 @@ - [数据管理](../08_data/README.md):数据持久化方案 - [删除镜像](../04_image/4.3_rm.md):清理镜像 - [数据卷](../08_data/8.1_volume.md):数据卷管理 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/06_repository/summary.md b/06_repository/summary.md index 45c72c8..4df1712 100644 --- a/06_repository/summary.md +++ b/06_repository/summary.md @@ -13,3 +13,6 @@ - [私有仓库](6.2_registry.md):搭建自己的 Registry - [镜像加速器](../03_install/3.9_mirror.md):加速下载 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/07_dockerfile/summary.md b/07_dockerfile/summary.md index 8169b94..54fbd0f 100644 --- a/07_dockerfile/summary.md +++ b/07_dockerfile/summary.md @@ -28,3 +28,6 @@ - [Dockerfile 最佳实践](../appendix/best_practices.md):编写指南 - [安全](../18_security/README.md):容器安全实践 - [Compose 模板文件](../11_compose/11.5_compose_file.md):Compose 中的配置 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/08_data/summary.md b/08_data/summary.md index 6470380..ed94572 100644 --- a/08_data/summary.md +++ b/08_data/summary.md @@ -24,3 +24,6 @@ - [tmpfs 挂载](8.3_tmpfs.md):内存中的临时存储 - [存储驱动](../12_implementation/12.4_ufs.md):Docker 存储的底层原理 - [Compose 数据管理](../11_compose/11.5_compose_file.md):Compose 中的挂载配置 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/09_network/summary.md b/09_network/summary.md index 3ed4216..70cc04f 100644 --- a/09_network/summary.md +++ b/09_network/summary.md @@ -22,3 +22,6 @@ - [网络隔离](9.6_network_isolation.md):网络安全与隔离策略 - [EXPOSE 指令](../07_dockerfile/7.9_expose.md):在 Dockerfile 中声明端口 - [Compose 网络](../11_compose/11.5_compose_file.md):Compose 中的网络配置 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/10_buildx/summary.md b/10_buildx/summary.md index 737d55b..7d6e76b 100644 --- a/10_buildx/summary.md +++ b/10_buildx/summary.md @@ -17,3 +17,6 @@ Docker Buildx 是 Docker 构建系统的重要进化,提供了高效、安全 - [Dockerfile 指令详解](../07_dockerfile/README.md):Dockerfile 编写基础 - [多阶段构建](../07_dockerfile/7.17_multistage_builds.md):优化镜像体积 - [Dockerfile 最佳实践](../appendix/best_practices.md):编写高效 Dockerfile +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/11_compose/summary.md b/11_compose/summary.md index 57bf578..d98f41e 100644 --- a/11_compose/summary.md +++ b/11_compose/summary.md @@ -19,3 +19,6 @@ Docker Compose 是管理多容器应用的利器,通过 YAML 文件声明式 - [Compose 命令说明](11.4_commands.md):完整命令列表 - [网络配置](../09_network/README.md):Docker 网络基础 - [数据管理](../08_data/README.md):数据卷管理 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/12_implementation/summary.md b/12_implementation/summary.md index f6d68b3..d88bfbe 100644 --- a/12_implementation/summary.md +++ b/12_implementation/summary.md @@ -34,3 +34,6 @@ - [镜像](../02_basic_concept/2.1_image.md):理解镜像分层 - [容器](../02_basic_concept/2.2_container.md):容器存储层 - [构建镜像](../04_image/4.5_build.md):Dockerfile 层的创建 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/13_kubernetes_concepts/summary.md b/13_kubernetes_concepts/summary.md index b0d4d7f..213634e 100644 --- a/13_kubernetes_concepts/summary.md +++ b/13_kubernetes_concepts/summary.md @@ -17,3 +17,6 @@ Kubernetes 是当前最主流的容器编排平台,其声明式管理模型和 - [部署 Kubernetes](../14_kubernetes_setup/README.md):搭建 Kubernetes 集群 - [Etcd](../15_etcd/README.md):Kubernetes 使用的分布式存储 - [底层实现](../12_implementation/README.md):容器技术原理 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/14_kubernetes_setup/summary.md b/14_kubernetes_setup/summary.md index c601298..856a4f2 100644 --- a/14_kubernetes_setup/summary.md +++ b/14_kubernetes_setup/summary.md @@ -15,3 +15,6 @@ - [容器编排基础](../13_kubernetes_concepts/README.md):Kubernetes 核心概念 - [Dashboard](14.7_dashboard.md):部署可视化管理界面 - [kubectl](14.8_kubectl.md):命令行工具使用指南 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/15_etcd/summary.md b/15_etcd/summary.md index a386517..2779191 100644 --- a/15_etcd/summary.md +++ b/15_etcd/summary.md @@ -15,3 +15,6 @@ etcd 是 Kubernetes 的核心存储组件,为分布式系统提供可靠的键 - [容器编排基础](../13_kubernetes_concepts/README.md):Kubernetes 如何使用 etcd - [部署 Kubernetes](../14_kubernetes_setup/README.md):在集群中部署 etcd +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/16_cloud/summary.md b/16_cloud/summary.md index fd3c1fb..9e8c18a 100644 --- a/16_cloud/summary.md +++ b/16_cloud/summary.md @@ -11,3 +11,6 @@ * 利用公有云和 Docker 的特性更加方便的迁移和扩展应用。 同时,容器将作为与虚拟机类似的业务直接提供给用户使用,极大的丰富了应用开发和部署的场景。 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/17_ecosystem/summary.md b/17_ecosystem/summary.md index d9e8405..153c9f0 100644 --- a/17_ecosystem/summary.md +++ b/17_ecosystem/summary.md @@ -28,3 +28,6 @@ Docker 并非容器生态的唯一选择,了解其他工具有助于根据场 - [底层实现](../12_implementation/README.md):容器技术的内核基础 - [安全](../18_security/README.md):容器安全实践 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/18_security/summary.md b/18_security/summary.md index dd909ee..83aeb4b 100644 --- a/18_security/summary.md +++ b/18_security/summary.md @@ -5,3 +5,6 @@ Docker 的安全性依赖于多层隔离机制的协同工作,同时需要用 总体来看,Docker 容器还是十分安全的,特别是在容器内不使用 root 权限来运行进程的话。 另外,用户可以使用现有工具,比如 [Apparmor](https://docs.docker.com/engine/security/apparmor/),[Seccomp](https://docs.docker.com/engine/security/seccomp/),SELinux,GRSEC 来增强安全性;甚至自己在内核中实现更复杂的安全机制。 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/19_observability/summary.md b/19_observability/summary.md index 0ee6032..ea6156f 100644 --- a/19_observability/summary.md +++ b/19_observability/summary.md @@ -47,3 +47,6 @@ Docker 提供了多种日志驱动 (Log Driver),用于将容器标准输出的 * Elasticsearch 数据目录已持久化,并有明确的日志保留周期与容量上限策略。 * Kibana 能查询到最新日志;当 UI 异常时能用 Elasticsearch API 验证入库。 * 可观测性组件未直接暴露到公网,访问已加鉴权或置于内网。 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/20_cases_os/README.md b/20_cases_os/README.md index 229bbd3..c7befe2 100644 --- a/20_cases_os/README.md +++ b/20_cases_os/README.md @@ -1,9 +1,23 @@ # 第二十章 实战案例 - 操作系统 -本章将介绍 Docker 在不同操作系统镜像场景下的实战案例。 +## 章节概述 -* [Busybox](20.1_busybox.md) -* [Alpine](20.2_alpine.md) -* [Debian Ubuntu](20.3_debian.md) -* [CentOS Fedora](20.4_centos.md) +本章将介绍 Docker 在不同操作系统镜像场景下的实战案例。当你构建容器化应用时,选择合适的基础镜像至关重要。不同的操作系统镜像在大小、功能和性能方面各有特点,适用于不同的使用场景。本章通过具体的案例,详细讲解如何在 Docker 中使用主流操作系统镜像,包括轻量级镜像 (Busybox、Alpine) 和完整功能镜像 (Debian、Ubuntu、CentOS 等)。 + +## 学习目标 + +通过学习本章内容,你将能够: + +- 理解不同操作系统镜像的特点和适用场景 +- 掌握在 Docker 中使用各类操作系统镜像的方法 +- 学习如何根据实际需求选择合适的基础镜像 +- 了解如何在容器中安装和配置应用程序 +- 掌握镜像优化和大小控制的最佳实践 + +## 章节内容导航 + +* [Busybox](20.1_busybox.md) — 超轻量级工具集镜像,适合嵌入式和最小化容器 +* [Alpine](20.2_alpine.md) — 轻量级 Linux 镜像,广泛用于生产环境微服务 +* [Debian Ubuntu](20.3_debian.md) — 功能完整的通用 Linux 镜像,生态丰富 +* [CentOS Fedora](20.4_centos.md) — 企业级 Linux 镜像,适合复杂系统应用 * [本章小结](summary.md) diff --git a/20_cases_os/summary.md b/20_cases_os/summary.md index 227bcdf..500a8f9 100644 --- a/20_cases_os/summary.md +++ b/20_cases_os/summary.md @@ -9,3 +9,6 @@ * 官方镜像体积都比较小,只带有一些基本的组件。精简的系统有利于安全、稳定和高效的运行,也适合进行个性化定制。 * 出于安全考虑,几乎所有官方制作的镜像都没有安装 SSH 服务,无法通过用户名和密码直接登录到容器中。 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/21_case_devops/README.md b/21_case_devops/README.md index 45b1a42..b736570 100644 --- a/21_case_devops/README.md +++ b/21_case_devops/README.md @@ -1,12 +1,31 @@ # 第二十一章 实战案例 - DevOps -本章将介绍 Docker 在 DevOps 场景下的实战案例。 +## DevOps 背景介绍 -* [DevOps 完整工作流](21.1_devops_workflow.md) -* [GitHub Actions](21.2_github_actions.md) -* [Drone](21.3_drone.md) -* [Drone Demo](21.4_drone_demo.md) -* [在 IDE 中使用 Docker](21.5_ide.md) -* [VS Code](21.6_vsCode.md) -* [实战例子](21.7_practical_examples.md) +DevOps 是一种重要的开发和运维文化,强调开发团队和运维团队之间的协作和自动化。它致力于通过自动化和流程优化,加快软件交付速度,同时提高系统的稳定性和可靠性。Docker 作为容器化技术的领导者,已成为现代 DevOps 工作流中不可或缺的工具。通过容器化应用,开发团队可以确保"一次构建,处处运行",消除开发、测试和生产环境的差异,大大简化了部署流程。 + +## Docker 在 DevOps 中的角色 + +Docker 在 DevOps 工作流中承担多个关键角色。首先,它标准化了应用的开发和部署环境,使得团队成员在相同的 Docker 容器中工作,避免了"在我的机器上可以运行"的问题。其次,Docker 与 CI/CD 流程无缝集成,通过自动化的镜像构建、测试和部署,实现快速的迭代周期。此外,Docker 还支持微服务架构和容器编排,使团队能够更灵活地扩展应用和管理基础设施。 + +## 本章学习目标 + +通过学习本章内容,你将能够: + +- 理解 DevOps 的核心原则和 Docker 的作用 +- 掌握完整的 Docker 工作流,从代码提交到线上部署 +- 学习如何使用 GitHub Actions 实现自动化 CI/CD +- 了解 Drone 等第三方 CI/CD 工具的集成方式 +- 学会在本地 IDE 中集成 Docker,提升开发效率 +- 掌握实战中常见的 DevOps 场景和最佳实践 + +## 章节内容导航 + +* [DevOps 完整工作流](21.1_devops_workflow.md) — 从代码到部署的全流程 +* [GitHub Actions](21.2_github_actions.md) — 使用 GitHub Actions 实现 CI/CD +* [Drone](21.3_drone.md) — Drone CI/CD 平台简介和配置 +* [Drone Demo](21.4_drone_demo.md) — Drone 实战演示和应用 +* [在 IDE 中使用 Docker](21.5_ide.md) — IDE 与 Docker 集成的好处 +* [VS Code](21.6_vsCode.md) — Visual Studio Code 容器开发指南 +* [实战例子](21.7_practical_examples.md) — 真实项目中的 DevOps 应用案例 * [本章小结](summary.md) diff --git a/21_case_devops/summary.md b/21_case_devops/summary.md index 0187e71..a143dbd 100644 --- a/21_case_devops/summary.md +++ b/21_case_devops/summary.md @@ -14,3 +14,6 @@ * 已在用 GitHub:优先补全 Actions 的缓存、制品、发布策略。 * 自建体系:结合私有 Registry、Kubernetes 与 GitOps 工具完善部署与审计。 +--- + +> 📝 **发现错误或有改进建议?** 欢迎提交 [Issue](https://github.com/yeasy/docker_practice/issues) 或 [PR](https://github.com/yeasy/docker_practice/pulls)。 diff --git a/README.md b/README.md index 445f078..5222aba 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,40 @@ * **深入原理**:第 12 ~ 17 章介绍其底层实现技术,深入探讨容器编排体系 (Kubernetes、Etcd),并延伸涉及容器与云计算及其它关键生态项目 (Fedora CoreOS、Podman 等)。 * **实战扩展**:第 18 ~ 21 章重点讨论容器安全防护机制、监控与日志聚合系统 (Prometheus、ELK),并展示操作系统、CI/CD 自动化构建等典型实践案例。 +## 五分钟快速上手 + +"5分钟运行第一个容器"——跟随以下步骤快速体验 Docker: + +1. **安装 Docker**(第1章):根据操作系统完成 Docker 的安装与验证 +2. **第一个容器**:执行 `docker run hello-world`,体验最简单的容器运行 +3. **交互式容器**:执行 `docker run -it ubuntu bash`,进入容器内部与系统交互 +4. **镜像与仓库**(第2-3章):理解镜像的概念、查找镜像、拉取和使用官方镜像 +5. **自定义镜像**(第5章):学习如何编写 Dockerfile 创建自己的镜像 + +## 学习路线图 + +```mermaid +graph LR + Start[Docker 学习入口] --> Ch1[第1章:基础安装] + + Ch1 --> Role1["运维新手
第1-4章"] + Ch1 --> Role2["开发者
第1-3章 → 第5-8章"] + Ch1 --> Role3["DevOps 工程师
第1章 → 第9-14章 → 第18章"] + Ch1 --> Role4["架构师
第1章 → 第15-21章"] + + Role1 --> End1["掌握基本操作"] + Role2 --> End2["构建与部署应用"] + Role3 --> End3["自动化与运维"] + Role4 --> End4["设计容器方案"] +``` + +| 读者角色 | 学习重点 | 核心成果 | +|---------|---------|---------| +| **运维新手** | 第1-4章 | 掌握容器的基本概念与操作 | +| **开发者** | 第1-3章 → 第5-8章 | 学会容器化应用的构建与部署 | +| **DevOps 工程师** | 第1章 → 第9-14章 → 第18章 | 实现容器编排与自动化部署流程 | +| **架构师** | 第1章 → 第15-21章 | 设计高可用、高性能的容器基础设施 | + ## 阅读方式 本书按需提供多种阅读模式,具体如下: @@ -78,6 +112,15 @@ npx honkit serve * [京东图书][1] * [天猫图书](https://detail.tmall.com/item.htm?id=997383773726&skuId=6143496614475) +## 推荐阅读 + +本书是技术丛书的一部分。以下书籍与本书形成互补: + +| 书名 | 与本书的关系 | +|------|------------| +| [《区块链技术指南》](https://github.com/yeasy/blockchain_guide) | 利用 Docker 部署区块链节点 | +| [《OpenClaw 从入门到精通》](https://github.com/yeasy/openclaw_guide) | 利用 Docker 部署 AI 智能体 | + ## 鼓励项目