Q. What is the role of Docker's 'CMD' instruction in a Dockerfile?

  • (A) To set the default command to be executed when a container starts
  • (B) To specify the environment variables
  • (C) To specify the base image for the container
  • (D) To expose container ports
πŸ’¬ Discuss
βœ… Correct Answer: (A) To set the default command to be executed when a container starts
Explanation: 'CMD' specifies the default command to be executed when the container starts.
Explanation by: Gopal Sharma
'CMD' specifies the default command to be executed when the container starts.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
196
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Gopal Sharma
Publisher
πŸ“ˆ
81%
Success Rate