nerdexam
CompTIACompTIA

XK0-005 · Question #1882

XK0-005 Question #1882: Real Exam Question with Answer & Explanation

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

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#Containerization#Entrypoint#Scripting

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions