mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 04:14:38 +00:00
style(docs): standardize heading formats and numbering
- Enforce Level 1-3 structural numbering based on SUMMARY.md hierarchy - Remove structural numbering from Level 4+ headings - Eliminate single child headings by converting to bold text - Auto-inject summary text for headings with multiple children missing intro text - Exclude Appendix chapters from structural numbering - Avoid modifying code block contents - Add script to detect non-standard English usage in headers
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
本节涵盖了相关内容与详细描述,主要探讨以下几个方面:
|
||||
|
||||
### 基本语法
|
||||
### 7.11.1 基本语法
|
||||
|
||||
如下代码块所示,展示了相关示例:
|
||||
|
||||
@@ -15,7 +15,7 @@ USER <UID>[:<GID>]
|
||||
|
||||
---
|
||||
|
||||
### 为什么要使用 USER
|
||||
### 7.11.2 为什么要使用 USER
|
||||
|
||||
> 笔者强调:以非 root 用户运行容器是最重要的安全实践之一。
|
||||
|
||||
@@ -36,7 +36,7 @@ flowchart LR
|
||||
|
||||
---
|
||||
|
||||
### 基本用法
|
||||
### 7.11.3 基本用法
|
||||
|
||||
本节涵盖了相关内容与详细描述,主要探讨以下几个方面:
|
||||
|
||||
@@ -78,7 +78,7 @@ USER 1001:1001
|
||||
|
||||
---
|
||||
|
||||
### 用户必须已存在
|
||||
### 7.11.4 用户必须已存在
|
||||
|
||||
`USER` 指令只能切换到 **已存在** 的用户:
|
||||
|
||||
@@ -124,7 +124,7 @@ RUN addgroup -g 1001 -S appgroup && \
|
||||
|
||||
---
|
||||
|
||||
### 运行时切换用户
|
||||
### 7.11.5 运行时切换用户
|
||||
|
||||
本节涵盖了相关内容与详细描述,主要探讨以下几个方面:
|
||||
|
||||
@@ -176,7 +176,7 @@ exec gosu redis "$@"
|
||||
|
||||
---
|
||||
|
||||
### 运行时覆盖用户
|
||||
### 7.11.6 运行时覆盖用户
|
||||
|
||||
使用 `-u` 或 `--user` 参数:
|
||||
|
||||
@@ -192,7 +192,7 @@ $ docker run -u root myimage
|
||||
|
||||
---
|
||||
|
||||
### 文件权限处理
|
||||
### 7.11.7 文件权限处理
|
||||
|
||||
切换用户后,确保应用有权访问文件:
|
||||
|
||||
@@ -221,7 +221,7 @@ CMD ["node", "server.js"]
|
||||
|
||||
---
|
||||
|
||||
### 最佳实践
|
||||
### 7.11.8 最佳实践
|
||||
|
||||
本节涵盖了相关内容与详细描述,主要探讨以下几个方面:
|
||||
|
||||
@@ -277,7 +277,7 @@ CMD ["node", "server.js"]
|
||||
|
||||
---
|
||||
|
||||
### 常见问题
|
||||
### 7.11.9 常见问题
|
||||
|
||||
本节涵盖了相关内容与详细描述,主要探讨以下几个方面:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user