Dockerfile instructions
Dockerfile CMD
Defines replaceable runtime defaults. Without an entrypoint the command can be replaced by arguments after the image name; with an exec-form entrypoint CMD may supply its default arguments. Last CMD wins. Runtime replacement semantics depend on whether an entrypoint is configured.
Formal Syntax & Structure
docker syntaxdocker
CMD ["executable", "arg", ...] | CMD ["arg", ...] | CMD <command>Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| executable | string | Program name when CMD supplies the command. |
| arg | string | Default argument. |
Working Example
Example Snippetdocker
FROM busybox:1.37CMD ["echo", "hello from image"]