Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-05-11 10:41:27
When you run a container, the default command provided by the container image is run by default. If you want to run a specific command or override the defaults provided by the container image, you can define these fields:
You can specify a working directory to run the command that you define for a container. If the container image does not provide a working directory and you do not specify it in the KCE console either, the command is run in the root directory (/) of the container by default.
A Docker image stores image metadata, including the ENTRYPOINT and CMD fields that specify a default command and its arguments respectively. When a container is run with the Docker image, the default command is run with the specified arguments. You can set the command and args fields in the configuration file of a container to define a command and arguments for the container. The command and arguments that you define override the defaults of ENTRYPOINT and CMD in the Docker image. For more information, see ENTRYPOINT and CMD.
When you override the default ENTRYPOINT and CMD, these rules apply:
The following table provides some examples.
Image ENTRYPOINT | Image CMD | Container command | Container args | Command run |
---|---|---|---|---|
[touch] | [/usr/test] | Not set | Not set | [touch /usr/test] |
[touch] | [/usr/test] | [mkdir] | Not set | [mkdir] |
[touch] | [/usr/test] | Not set | [opt/test] | [touch /opt/test] |
[touch] | [/usr/test] | [mkdir] | [opt/test] | [mkdir /opt/test] |
Pure Mode