docs(content): add Mac alternatives, K8s transition guide, CI/CD registry push example

- Add OrbStack/Colima comparison table to Mac install chapter (3.7.4)
- Add Docker→K8s concept mapping paragraph to Ch13 intro
- Add KubeKey/RKE2 deployment tool notes to Ch14
- Add production image checklist to Dockerfile chapter summary
- Add build-and-push-to-registry workflow example to GitHub Actions section
- Expand Ch18 security summary with dimension table
This commit is contained in:
yeasy
2026-05-21 21:33:58 -07:00
parent dae0af9ae7
commit 8b9e4518c8
6 changed files with 100 additions and 3 deletions
+15
View File
@@ -21,6 +21,21 @@
| **LABEL** | 添加元数据 | 推荐 OCI 标准标签替代 MAINTAINER |
| **SHELL** | 更改默认 shell | 推荐 `["/bin/bash", "-o", "pipefail", "-c"]` |
### 生产镜像快速检查清单
在将镜像推向生产之前建议逐条过一遍以下清单
- [ ] 基础镜像选择了最小化版本 `alpine``distroless`
- [ ] 使用了[多阶段构建](7.17_multistage_builds.md)最终镜像不含编译工具链
- [ ] 以非 root 用户运行`USER` 指令
- [ ] `COPY` 优先于 `ADD`且仅复制必要文件
- [ ] `RUN` 指令合并了 `apt-get update && install && rm -rf /var/lib/apt/lists/*`
- [ ] 设置了 `HEALTHCHECK`
- [ ] 使用了 `.dockerignore` 排除 `.git``node_modules` 等无关文件
- [ ] 镜像标签使用了具体版本号或 commit hash而非 `latest`
> 更完整的编写指南见[附录Dockerfile 最佳实践](../appendix/best_practices.md)
### 延伸阅读
- [使用 Dockerfile 定制镜像](../04_image/4.5_build.md)Dockerfile 入门