XK0-005 · Question #887
XK0-005 Question #887: 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).
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
Community Discussion
No community discussion yet for this question.