Kubernetes and Cloud Native Associate (KCNA) — Question 93
What is a Dockerfile?
Answer options
- A. A bash script that is used to automatically build a docker image.
- B. A config file that defines which image registry a container should be pushed to.
- C. A text file that contains all the commands a user could call on the command line to assemble an image.
- D. An image layer created by a running container stored on the host.
Correct answer: C
Explanation
The correct answer is C, as a Dockerfile is indeed a text file that specifies the instructions for building a Docker image. Option A describes a bash script, which is not the same as a Dockerfile. Option B refers to configuration related to image registries, which does not define the contents of a Dockerfile. Option D discusses an image layer from a running container, which is unrelated to the purpose of a Dockerfile.