yeasy
12c2acca52
fix(命令): 五处照抄跑不起来,另修四处违反本书自己规则的写法
...
跑不起来的五处:
- 11.5:604 的 Compose 示例里 `db:` 顶在第 0 列,是**顶级键而不是服务**。
实测 yaml 解析结果是 `{'services': None, 'db': {...}}`,`docker compose up`
直接报错。同文件其他服务示例都缩进正确。
- 10.3 的 `docker manifest create` 把 `--amend` 当成每个 manifest 的前缀写了
两遍。upstream `docker/cli` 里它是 `BoolVarP(&opts.amend, "amend", "a", ...)`,
不取值;用法是 `create MANIFEST_LIST MANIFEST [MANIFEST...]`。照抄不仅参数
错位,还会打开"修改已有列表"的语义。改为直接跟位置参数。
- 21.7:288 `apk add postgresql-contrib pg-stat-monitor`。核对 Alpine v3.23 的
APKINDEX(427828 行,直接解包官方索引):这两个包名都**不存在**,Alpine 只
提供带主版本号的 `postgresql16-contrib` 等;`apk add` 遇到未知包会中止,
该 Dockerfile 卡在第二步。改为 postgresql16-contrib 并去掉 pg-stat-monitor,
同时注明原因。
- 19.3:528 用 `pip install --user` 装到 `/root/.local`,运行阶段却 `USER nobody`。
Debian 的 `/root` 是 0700,nobody 无法进入,容器起来就找不到依赖。改为装到
`/opt/pydeps`(PYTHONUSERBASE)并同步 COPY 与 PATH。
- 11.8:202 的 `WORDPRESS_REDIS_HOST` 不被官方镜像识别——`wp-config-docker.php`
只映射固定的一组 WORDPRESS_* 变量,其中没有 Redis 项;Redis Object Cache
插件读的是 PHP 常量 `WP_REDIS_HOST`。改为经 `WORDPRESS_CONFIG_EXTRA` 注入。
违反本书自己规则的四处:
- 全书 21 处 `FROM ... as`(13 处在正文、8 处在 Dockerfile)用小写 as,会被
`docker buildx build --check` 的 FromAsCasing 报
`'as' and 'FROM' keywords' casing do not match`——而本书正是拿 `--check`
当准绳(7.6:16、10.2:23),且自己另有 12 处已经写成大写 AS。统一为 AS,
并把 7.17:174 那句"可以使用 `as` 来为某一阶段命名"一并改掉并附上检查项链接。
- 6.3:137 建议"可替换为 `httpd:latest`",而同文件 22 行之后就写着"不要使用
`latest`,以保证部署的可重复性"。删去该建议。
- 7.6:253 写"多个 ENV 会创建多层",而 4.5:5 明确区分过:只改元数据的指令
不新增文件系统层。ENV 正属于后者。改为"多出几条构建历史记录"。
核验方式的一点说明:查 Alpine 包是否存在时,我先用网页搜索接口做了一遍,
结果四个包名全部"命中"(包括本不该存在的那个)——那个页面会把查询词回显。
改用官方 APKINDEX 解包比对后才得到可信结论,两种方法交叉确认后才动手。
2026-09-04 15:01:00 -07:00
yeasy
ef2625531d
style: 含中文的括号统一为全角(336 处 / 110 文件)
...
全书此前是真·五五开:含中文的括号 336 处半角 : 336 处全角,而且**在同一文件
内混用**——`18_security/18.1_kernel_ns.md` 第 11/17/20 行写 `(如 runC)`,
第 31 行写 `(用户命名空间映射)`。这不是体例问题,是它自己跟自己不一致。
集群里其余 13 本都一边倒(llm_internals 5 : 1049、oc_guide 2 : 713、
forward_deployed_engineering_guide 0 : 108),blockchain_guide 已在 2026-08-05
按同一方向统一过 97 处,故取全角,而非另立新规。全角括号前后不留空格,
原先 `概念 (镜像、容器、仓库) 和` 两侧的空格一并收掉。
**纯拉丁内容的半角括号一个没动**——`新建一个层 (Layer)`、`项目 (project)`
保持原样:改动前后「半角且内容纯拉丁」的数量都是 **1163**,而「半角且含中文」
从 **336 变成 0**。
其余验证:改动前后各自抹掉全部空白与圆括号后**逐字节相同**(两侧均 19559 字符);
左右括号总数改动前后都是 399 : 399,证明没有吞括号也没有配错对。
`check_project_rules` 202/202、`check_emphasis` 202/202、37 tests OK、
根 `format_checker` 与 `validate_codeblocks` 干净、`git diff --check` 干净。
2026-08-24 13:13:23 -07:00
yeasy
42253fc1e8
fix(ci): 示例里的 GitHub Actions 大版本标签落后上游
...
第 18、21 章的工作流示例仍用 actions/checkout@v6 与 actions/upload-artifact@v4,
而上游当前大版本分别是 v7.0.1(2026-07-20)与 v7.0.1(2026-04-10);本仓库自己的
.github/workflows/* 早已按 SHA 钉在 v7.0.1 上,书里教的和书自己在跑的不一致。
21.2 更是同一个文件内自相矛盾:第 27/108 行写 @v6,第 59 行却钉着 v7.0.0 的 SHA。
sigstore/cosign-installer 一并从 @v3 提到 @v4.1.2:官方 v4.0.0 发布说明写明
"You must upgrade to cosign-installer v4 if you want to install Cosign v3+",
而 18.6 手工安装那段用的是 releases/latest(今天就是 Cosign 3.x),两条路径装的
不是同一个大版本。该仓库没有可移动的 v4 标签,只能引用完整版本号,已就地加注说明。
docker/{build-push,setup-buildx,login}-action、anchore/sbom-action@v0、
github/codeql-action@v3 逐一核对后确认仍是当前受支持版本,未改动;
trivy-action 的 SHA 57a97c7e 经 GitHub API 核对确与 v0.35.0 一致,注释无误。
2026-08-07 23:24:00 -07:00
yeasy
ee0fbd7d38
fix(ci): attest releases and validate offline examples
2026-07-10 19:29:30 -07:00
yeasy
daa6661b2b
fix(ci): harden publishing and validate examples
2026-07-10 19:29:30 -07:00
yeasy
9fdffa9d91
fix(content): harden Docker practice guide
2026-06-16 21:23:21 -07:00
yeasy
0cfd55af7b
fix(content): repair Django tutorial crash and complete the hardening sweep
...
Follow-ups to the 9 secret-hardening commits (each verified against
docs.docker.com / vendor docs; one outright new bug found and fixed):
- 11.6: eb5e4397 changed settings.py to a hard os.environ lookup but the
web service never receives POSTGRES_PASSWORD (only db does; DATABASE_URL
is set but never read) -> step-6 'docker compose up' crashed with
KeyError. Pass the var to web; harden the leftover literal password in
the 配置详解 snippet that contradicted the new guidance two lines down;
blank line after the inserted sentence (bold heading merged into the
paragraph); dev/prod table no longer claims dev uses 明文 passwords
- 11.8: FAQ still told readers to check passwords in .env after the same
file banned passwords in .env -> point at secrets/db_password.txt;
backup sidecar env vars updated to tiredofit/db-backup 4.x interface
(DB01_* + DB01_PASS_FILE + DB01_BACKUP_INTERVAL - the unprefixed DB_*
names are ignored by current :latest; verified against upstream README)
- demo/wordpress: compose now references secrets files that ship nowhere
-> add README with the creation commands from 11.8; demo/django: align
with the hardened 11.6 (env-injected password, passed to web too)
- 04_image multistage demos: go build without go.mod fails on module-mode
Go (reproduced by reviewer on go1.26) -> add 'go mod init helloworld'
matching the 7.17 doc pattern in all three Dockerfiles
- 21.7: init script reworked init-db.sql -> init-db.sh per the official
image's env-reading .sh hook - removes the baked 'secure_password' AND
the CREATE DATABASE myappdb collision with POSTGRES_DB that aborted
first-boot init (ON_ERROR_STOP); compose passes APP_DB_PASSWORD;
microservices init.sql mount annotated schema-only (POSTGRES_USER:
appuser would collide with CREATE USER); Dockerfile-redis healthcheck
now authenticates via REDISCLI_AUTH read from redis.conf (plain
redis-cli ping gets NOAUTH against requirepass - same class as the
compose sibling eb5e4397 already fixed); dev-container dev/dev creds
annotated local-only
- 19.3: Grafana admin password 'admin' sat directly under the newly added
security warning -> env-injected like the rest of the stack
2026-06-10 12:06:57 -07:00
yeasy
eb5e4397e8
docs: remove hardcoded compose secrets
2026-06-08 16:16:36 -07:00
yeasy
6fc032f7d6
应用专业编辑审查:修复版本/引用/技术准确性等 3 处
2026-06-01 11:11:28 -07:00
yeasy
1cdd3c582a
fix(content): harden Docker examples
2026-06-01 10:33:50 -07:00
yeasy
ec0fa15835
docs(content): harden Kubernetes and supply-chain examples
2026-05-22 00:53:38 -07:00
yeasy
8b9e4518c8
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
2026-05-21 21:33:58 -07:00
yeasy
d47afa7e75
docs: harden Docker practice security examples
2026-05-20 15:58:46 -07:00
yeasy
3c5c5911b0
Fix nginx version, IPVS removal, cgroups v2 and Redis config
2026-05-13 08:22:20 +00:00
yeasy
99c56217f5
Fix Chinese curly quote direction
2026-04-29 05:21:02 +00:00
yeasy
30f0115cb9
Update nginx, OS, Buildx, etcd and K8s refs
2026-04-28 12:22:57 +00:00
Baohua Yang
aa204fb454
chore: lint cleanup and version corrections
...
- Accept benign linter changes (version notes, explicit tags, formatting)
- Fix incorrect version downgrades introduced by linter:
- golang:1.22→1.26 (restored)
- rust:1.82→1.95 (restored)
- 23 files updated
2026-04-25 15:58:27 +00:00
yeasy
515ba9f64a
Add blank lines before lists per CommonMark
2026-04-25 15:13:27 +00:00
yeasy
9abc1cbb69
Update Kubernetes to v1.36, build-push-action to v7
2026-04-25 15:10:51 +00:00
yeasy
c9c72618c3
Refresh k8s docker versions and references
2026-04-21 20:57:33 -07:00
yeasy
85f76aa6d9
Fix guide issues
2026-03-28 18:24:46 -07:00
Baohua Yang
b67d5367dc
chore: update content and add generated PDF
2026-03-27 08:43:47 -07:00
yeasy
d6abed17da
Simplify CI to mdpress only
2026-03-25 21:57:30 -07:00
yeasy
76c2ae50fe
Add blank lines around headers
2026-03-24 09:27:04 -07:00
yeasy
44b1307277
Remove blank lines after code block markers
2026-03-21 22:36:09 -07:00
yeasy
370949f226
Add blank lines before headers
2026-03-21 12:57:51 -07:00
Baohua Yang
8e8c554482
fix: update docker-compose V1 syntax to V2 and add release PDF workflow
...
Replace remaining docker-compose command references with docker compose (V2).
Add GitHub Actions workflow to auto-generate PDF via mdpress on release.
2026-03-19 20:21:06 -07:00
yeasy
c02a8a41cd
Update container runtime guidance
2026-03-16 20:49:00 -07:00
yeasy
b9c63a5133
Polish Docker workflow formatting
2026-03-16 00:32:49 -07:00
yeasy
224e2738ce
Replace straight quotes with curved quotes
2026-03-11 22:19:26 -07:00
yeasy
bdaeeaa740
Add details for cloud images
2026-03-09 20:04:22 -07:00
yeasy
a16e0879c0
Improve READMEs and add contribution prompts
2026-03-09 20:04:21 -07:00
baohua
20a69d1662
Fix typography
2026-03-09 20:04:13 -07:00
baohua
5df76d4836
Add practical examples
2026-03-05 22:23:06 -08:00
baohua
e8be1c4bbc
Optimize content and fix issues
2026-03-03 19:30:21 -08:00
Baohua Yang
217ca43f86
Refine words
2026-03-02 22:16:51 -08:00
Baohua Yang
9f67b560d9
Add security note
2026-02-28 14:28:38 -08:00
Baohua Yang
44c580c412
Reduce image size
2026-02-27 19:23:28 -08:00
Baohua Yang
5f32350c12
Add more content and fix format
2026-02-25 21:06:21 -08:00
Baohua Yang
5e8d7252be
Simplify words and fix format issues
2026-02-24 22:01:02 -08:00
Baohua Yang
13f59904c5
Fix all missed links
2026-02-24 21:06:40 -08:00
Baohua Yang
f0c6d7de95
Fix wrong links
2026-02-22 16:04:41 -08:00
Baohua Yang
caa3331cab
Split chapter 20
2026-02-22 15:33:20 -08:00