nerdexam
CompTIA

XK0-005 · Question #887

A systems administrator is building a database container. The container should perform different tasks based on the parameters that are provided during startup (for example, init, start, recover)…

The correct answer is D. ENTRYPOINT /startScript.sh. By using ENTRYPOINT, any arguments passed to docker run are appended to /startScript.sh, allowing you to invoke it with different parameters (e.g. docker run your‑image init or docker run your‑image recover).

Scripting, Containers, and Automation

Question

A systems administrator is building a database container. The container should perform different tasks based on the parameters that are provided during startup (for example, init, start, recover). The administrator wrote a startScript.sh script to achieve this objective. Which of the following Dockerfile statements would run the startScript.sh using the provided parameters?

Options

  • ARUN /startScript.sh
  • BCMD /startScript.sh
  • CEXPOSE /startScript.sh
  • DENTRYPOINT /startScript.sh

How the community answered

(33 responses)
  • A
    3% (1)
  • C
    3% (1)
  • D
    94% (31)

Explanation

By using ENTRYPOINT, any arguments passed to docker run are appended to /startScript.sh, allowing you to invoke it with different parameters (e.g. docker run your‑image init or docker run your‑image recover).

Topics

#Dockerfile#Docker ENTRYPOINT#Container startup#Parameter passing

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice