Add blank lines around headers

This commit is contained in:
yeasy
2026-03-24 09:27:04 -07:00
parent 857e3b73f6
commit ae8636e96f
112 changed files with 468 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ $ docker run -d \
--mount type=bind,source=/宿主机路径,target=/容器路径 \
nginx
```
#### 使用 -v简写
```bash
@@ -65,6 +66,7 @@ $ docker run -d \
-v /宿主机路径:/容器路径 \
nginx
```
#### 两种语法对比
| 特性 | --mount | -v |
@@ -97,6 +99,7 @@ $ echo "Hello" > src/index.html
...
```
#### 场景二配置文件挂载
```bash
@@ -106,6 +109,7 @@ $ docker run -d \
--mount type=bind,source=/path/to/nginx.conf,target=/etc/nginx/nginx.conf,readonly \
nginx
```
#### 场景三日志收集
```bash
@@ -115,6 +119,7 @@ $ docker run -d \
--mount type=bind,source=/var/log/myapp,target=/app/logs \
myapp
```
#### 场景四共享 SSH 密钥
```bash
@@ -227,6 +232,7 @@ $ docker run -u root ...
$ docker run -u $(id -u):$(id -g) ...
```
#### QmacOS/Windows 性能问题
Docker Desktop Bind Mount 性能较差 (需要跨文件系统同步)
@@ -253,6 +259,7 @@ $ docker run -v /host/path:/container/path:cached myapp
$ docker run -v $(pwd):/app -p 3000:3000 node npm run dev
```
#### 2. 生产环境使用 Volume
```bash
@@ -260,11 +267,13 @@ $ docker run -v $(pwd):/app -p 3000:3000 node npm run dev
$ docker run -v mysql_data:/var/lib/mysql mysql
```
#### 3. 配置文件使用只读挂载
```bash
$ docker run -v /config/nginx.conf:/etc/nginx/nginx.conf:ro nginx
```
#### 4. 注意路径安全
```bash