镜像和容器的Entrypoint和CMD
约 127 字
预计阅读 1 分钟
次阅读
Entrypoint和CMD
| No ENTRYPOINT | ENTRYPOINT exec_entry p1_entry | ENTRYPOINT [“exec_entry”, “p1_entry”] |
---|
No CMD | error, not allowed | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry |
CMD [“exec_cmd”, “p1_cmd”] | exec_cmd p1_cmd | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry exec_cmd p1_cmd |
CMD [“p1_cmd”, “p2_cmd”] | p1_cmd p2_cmd | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry p1_cmd p2_cmd |
CMD exec_cmd p1_cmd | /bin/sh -c exec_cmd p1_cmd | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry /bin/sh -c exec_cmd p1_cmd |
镜像和容器
镜像 Entrypint | 镜像 Cmd | 容器 command | 容器 args | 执行命令 |
---|
[/ep-1] | [foo bar] | | | [ep-1 foo bar] |
[/ep-1] | [foo bar] | [/ep-2] | | [ep-2] |
[/ep-1] | [foo bar] | | [zoo boo ] | [ep-1 zoo boo] |
[/ep-1] | [foo bar] | [/ep-2] | [zoo boo ] | [ep-2 zoo boo] |