701-100 Exam QuestionsBrowse all questions from this exam

701-100 Exam - Question 30


FILL BLANK -

Which statement in a Dockerfile defines which command should be started in the container by default when it is started? (Specify ONLY the statement's name without any values or parameters.)

Show Answer
Correct Answer:

The statement in a Dockerfile that defines which command should be started in the container by default when it is started is CMD. The CMD instruction provides defaults for an executing container, including the command to be executed. If the CMD instruction is missing, the ENTRYPOINT instruction can be used, but typically CMD is used to specify the default command.

Discussion

7 comments
Sign in to comment
mucmike
Jun 10, 2020

No, CMD this one is correct, read the Question again

jsdnhk
Jun 28, 2020

CMD Highlighted that, "The main purpose of a CMD is to provide defaults for an executing container." from https://docs.docker.com/engine/reference/builder/#cmd

hector1978
Feb 17, 2020

The correct answer is: FROM

melyess
Mar 2, 2020

Dockerfile must begin with a `FROM` instruction.

mri
Jun 25, 2020

ENTRYPOINT

gilbertlelancelo
Aug 2, 2021

Ans us CMD. The main purpose of a CMD is to provide defaults for an executing container. These defaults can include an executable, or they can omit the executable, in which case you must specify an ENTRYPOINT instruction as well. https://docs.docker.com/engine/reference/builder/#cmd

ignasi
Oct 22, 2022

entrypoint in theory is possible too, but usually is used to run executables, not commands, so cmd is better