CS FundamentalsModerateProduct-company MCQ pattern

A Dockerfile ends with CMD ["python", "app.py"]. The container is started with docker run myimage python test.py. What runs?

  1. A. python app.py
  2. B. python app.py python test.py
  3. C. python test.py
  4. D. The container fails to start

Correct answer: C. python test.py

Arguments after the image name replace CMD entirely. Had the Dockerfile used ENTRYPOINT ["python"] with CMD ["app.py"], the extra arguments would have replaced only the CMD part.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic