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

@@ -95,6 +95,7 @@ exec: "-i": executable file not found
...
```
#### 使用 ENTRYPOINT 解决
```docker
@@ -111,6 +112,7 @@ HTTP/1.1 200 OK
...
当前 IP61.148.226.66
```
#### 交互图示
```bash
@@ -160,6 +162,7 @@ fi
exec "$@"
```
#### 工作流程
```bash
@@ -173,6 +176,7 @@ docker-entrypoint.sh redis-server docker-entrypoint.sh bash
└─ exec gosu redis redis-server └─ exec bash
(以 redis 用户运行) (以 root 用户运行)
```
#### 关键点
1. **exec $@**用传入的参数替换当前进程确保信号正确传递
@@ -261,12 +265,14 @@ ENTRYPOINT ["python", "app.py"]
ENTRYPOINT python app.py
```
#### 2. 提供有意义的默认参数
```docker
ENTRYPOINT ["nginx"]
CMD ["-g", "daemon off;"]
```
#### 3. 入口脚本使用 exec
```bash
@@ -278,6 +284,7 @@ CMD ["-g", "daemon off;"]
exec "$@"
```
#### 4. 处理信号
确保 ENTRYPOINT 脚本能正确传递信号