Q60 — AWS DOP-C02 Ch.1

Question 60 of 100 | ← Chapter 1

A DevOps engineer frequently uses AWS CodeBuild to build software packages from source code. CodeBuild projects build Docker images, which developers reuse across multiple builds. The DevOps engineer wants to improve build performance and optimize cost. Which solution meets these requirements?

Correct Answer: A. Store Docker images in an Amazon Elastic Container Registry (Amazon ECR) repository. Enable local Docker layer caching for CodeBuild.

Explanation

In AWS CodeBuild, storing Docker images in Amazon ECR avoids redundant uploads/downloads. Enabling local Docker layer caching allows reuse of existing image layers during builds—reducing build time and network transfer costs, thereby improving performance and lowering cost. Option B’s S3-based caching is unsuitable for Docker’s layered architecture. Option C’s 'latest version' approach undermines caching by forcing re-pull. Option D’s EC2-based solution increases management overhead and startup latency. The combination of ECR and local layer caching best leverages container-specific optimizations while maximizing efficiency.