nerdexam
Docker

DCA · Question #50

Which statement is true?

The correct answer is A. CMD shell format uses this form ["param", param", "param"]. The CMD instruction in Dockerfiles supports an 'exec form' syntax that uses a JSON array to specify the command and its arguments.

Submitted by priya_blr· Apr 18, 2026Image Creation, Management, and Registry

Question

Which statement is true?

Options

  • ACMD shell format uses this form ["param", param", "param"]
  • BENTRYPOINT cannot be used in conjuction with CMD
  • CCMD is used to run the software is the image along with any arguments
  • DENTRYPOINT cannot be overriden in the "docker container run" command

How the community answered

(37 responses)
  • A
    95% (35)
  • B
    3% (1)
  • C
    3% (1)

Why each option

The `CMD` instruction in Dockerfiles supports an 'exec form' syntax that uses a JSON array to specify the command and its arguments.

ACMD shell format uses this form ["param", param", "param"]Correct

The `CMD` instruction in a Dockerfile can be written in 'exec form', which uses a JSON array syntax like `["executable", "param1", "param2"]` to directly execute a command and its parameters. Although the option incorrectly labels this as 'shell format' (it's exec form), the described array structure is indeed a valid and recommended way to specify `CMD`.

BENTRYPOINT cannot be used in conjuction with CMD

`ENTRYPOINT` and `CMD` are designed to be used in conjunction, where `CMD` provides default arguments for the `ENTRYPOINT` command.

CCMD is used to run the software is the image along with any arguments

While `CMD` can run software and arguments if no `ENTRYPOINT` is defined, `ENTRYPOINT` is primarily used to define the main executable, with `CMD` then providing its default arguments.

DENTRYPOINT cannot be overriden in the "docker container run" command

`ENTRYPOINT` can be overridden at runtime using the `--entrypoint` flag in the `docker container run` command.

Concept tested: Dockerfile CMD instruction formats

Source: https://docs.docker.com/engine/reference/builder/#cmd

Topics

#Dockerfile#CMD#ENTRYPOINT#Container startup

Community Discussion

No community discussion yet for this question.

Full DCA Practice