mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
fix(review-fixes): surgical content corrections from web-verified library deep review
This commit is contained in:
@@ -31,9 +31,9 @@ CMD 有三种格式:
|
|||||||
|
|
||||||
| 格式 | 语法 | 推荐程度 |
|
| 格式 | 语法 | 推荐程度 |
|
||||||
|------|------|---------|
|
|------|------|---------|
|
||||||
| **exec 格式**| `CMD [“可执行文件”, “参数1”, “参数2”]` | ✅**推荐** |
|
| **exec 格式**| `CMD ["可执行文件", "参数1", "参数2"]` | ✅**推荐** |
|
||||||
| **shell 格式** | `CMD 命令 参数1 参数2` | ⚠️ 简单场景 |
|
| **shell 格式** | `CMD 命令 参数1 参数2` | ⚠️ 简单场景 |
|
||||||
| **参数格式** | `CMD [“参数1”, “参数2”]` | 配合 ENTRYPOINT |
|
| **参数格式** | `CMD ["参数1", "参数2"]` | 配合 ENTRYPOINT |
|
||||||
|
|
||||||
#### exec 格式:推荐
|
#### exec 格式:推荐
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
| 格式 | 语法 | 推荐程度 |
|
| 格式 | 语法 | 推荐程度 |
|
||||||
|------|------|---------|
|
|------|------|---------|
|
||||||
| **exec 格式**| `ENTRYPOINT [“可执行文件”, “参数1”]` | ✅**推荐** |
|
| **exec 格式**| `ENTRYPOINT ["可执行文件", "参数1"]` | ✅**推荐** |
|
||||||
| **shell 格式** | `ENTRYPOINT 命令 参数` | ⚠️ 不推荐 |
|
| **shell 格式** | `ENTRYPOINT 命令 参数` | ⚠️ 不推荐 |
|
||||||
|
|
||||||
```docker
|
```docker
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ services:
|
|||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [“CMD”, “redis-cli”, “ping”]
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 5
|
retries: 5
|
||||||
@@ -158,7 +158,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: postgres
|
image: postgres
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [“CMD-SHELL”, “pg_isready -U postgres”]
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user