mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 16:37:34 +00:00
Update versions and fix formatting issues
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
在深入 CMD 的细节之前,我们需要理解一个关键问题:**CMD 和 ENTRYPOINT 应该在什么时候使用?**
|
||||
|
||||
这是 Dockerfile 使用中最常见的困惑之一。简单的答案是:
|
||||
|
||||
- **CMD**:定义容器的”默认命令”。如果用户在 `docker run` 时提供命令,CMD 会被覆盖
|
||||
- **ENTRYPOINT**:定义容器的”入口脚本”。通常用于启动应用的某个特定部分
|
||||
|
||||
|
||||
Reference in New Issue
Block a user