nerdexam
Linux_Foundation

KCNA · Question #64

What is a Dockerfile?

The correct answer is C. A text file that contains all the commands a user could call on the command line to assemble an. A Dockerfile is a plain text file that specifies a set of instructions used by the Docker engine to automatically build a Docker image.

Submitted by diego_uy· May 4, 2026Kubernetes Fundamentals

Question

What is a Dockerfile?

Options

  • AA bash script that is used to automatically build a docker image.
  • BA config file that defines which image registry a container should be pushed to.
  • CA text file that contains all the commands a user could call on the command line to assemble an
  • DAn image layer created by a running container stored on the host.

How the community answered

(41 responses)
  • A
    5% (2)
  • C
    93% (38)
  • D
    2% (1)

Why each option

A Dockerfile is a plain text file that specifies a set of instructions used by the Docker engine to automatically build a Docker image.

AA bash script that is used to automatically build a docker image.

While a Dockerfile defines steps for building, it is not a bash script; it uses its own specific syntax and commands like FROM, RUN, COPY, and CMD.

BA config file that defines which image registry a container should be pushed to.

A Dockerfile does not define the image registry; that is typically specified during the `docker push` command or configured in Docker daemon settings.

CA text file that contains all the commands a user could call on the command line to assemble anCorrect

A Dockerfile is a text file containing a series of instructions, each representing a command that Docker executes in order to build a new image. These instructions define the base image, environment variables, commands to run, files to copy, and ports to expose, among other things.

DAn image layer created by a running container stored on the host.

An image layer created by a running container stored on the host is part of the container's filesystem changes, not the Dockerfile itself, which defines how an image is built.

Concept tested: Dockerfile definition and purpose

Source: https://docs.docker.com/engine/reference/builder/

Topics

#Dockerfile#Docker Image#Image Building

Community Discussion

No community discussion yet for this question.

Full KCNA Practice