Microsoft Certified: DevOps Engineer ExpertConfigure processes and communicationsHard

A DevOps team is tasked with ensuring that all deployed artifacts are immutable and traceable back to their source code and build process. They want to implement a versioning strategy for their Docker images and other deployable units that automatically incorporates unique identifiers and reflects the build context. Which versioning approach would best support these requirements?

  1. ASequential Versioning (e.g., 1, 2, 3)
  2. BSemantic Versioning (e.g., 1.0.0)
  3. CDate-based Versioning (e.g., YYYYMMDD.HHMM)
  4. DGit Commit Hash / Build Number Versioning (e.g., 1.0.0-abcdef1.123)
Show answer & explanation

Correct answer: D. Git Commit Hash / Build Number Versioning (e.g., 1.0.0-abcdef1.123)

Using a Git commit hash (or a short version) directly links the artifact to the exact source code state. Appending a build number ensures uniqueness even if the same commit is built multiple times or on different systems. This combination guarantees immutability and precise traceability to both the source code and the specific build process, which is critical for Docker images and other deployable units in a DevOps pipeline.

Why the other options are wrong

  • A. Sequential Versioning provides no context about the source code or build and doesn't guarantee uniqueness across different build pipelines or systems.
  • B. Semantic Versioning (SemVer) is excellent for communicating API compatibility but doesn't inherently provide unique traceability to every specific build or commit, which is crucial for immutable artifacts.
  • C. Date-based Versioning provides a timestamp but doesn't directly link to the specific source code commit or guarantee uniqueness if multiple builds occur within the same minute.

Immutable Artifact Versioning

A versioning approach for deployable artifacts (e.g., Docker images) that incorporates unique identifiers like Git commit hashes and build numbers to ensure traceability and immutability.

  • Each artifact version is unique and never changes.
  • Directly links artifact to specific source code commit.
  • Often includes build number for instance uniqueness.
  • Crucial for reproducibility and debugging in production.

Memory trick: Commit hashes confirm each artifact's home.

More Configure processes and communications questions