nerdexam
Docker

DCA · Question #34

From a DevOps process standpoint, it is best practice to keep changes to an application in version control. Which of the following will allow changes to a docker Image to be stored in a version…

The correct answer is D. A dockerfile. To store changes to a Docker image in a version control system according to DevOps best practices, a Dockerfile is the appropriate method.

Submitted by lars.no· Apr 18, 2026Image Creation, Management, and Registry

Question

From a DevOps process standpoint, it is best practice to keep changes to an application in version control. Which of the following will allow changes to a docker Image to be stored in a version control system?

Options

  • Adocker commit
  • Bdocker save
  • CA docker-compose.yml file
  • DA dockerfile

How the community answered

(37 responses)
  • A
    3% (1)
  • C
    5% (2)
  • D
    92% (34)

Why each option

To store changes to a Docker image in a version control system according to DevOps best practices, a Dockerfile is the appropriate method.

Adocker commit

The `docker commit` command creates a new image from a running container's state, but the changes are not recorded in a human-readable, version-controlled script, making it non-reproducible and an anti-pattern for version control.

Bdocker save

The `docker save` command exports an image to a tar archive, which is a binary representation of the image and cannot be version-controlled in terms of its changes or definitions.

CA docker-compose.yml file

A `docker-compose.yml` file defines how multi-container applications are run and orchestrated, but it does not specify how individual Docker images are built or track their internal changes for version control.

DA dockerfileCorrect

A Dockerfile provides a scriptable, declarative definition of how an image is built, including its base image, dependencies, and application code. Placing the Dockerfile under version control allows all changes to the image's definition to be tracked, ensuring reproducibility and enabling a consistent CI/CD pipeline.

Concept tested: Dockerfile for reproducible image builds and version control

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

Topics

#docker commit#Image Creation#Image Versioning#Version Control

Community Discussion

No community discussion yet for this question.

Full DCA Practice