A DevOps engineer frequently builds large Docker images with AWS CodeBuild and wants to speed up builds and reduce cost by reusing image layers across builds. Which approach best improves build performance and minimizes operational effort?
Choose an answer
Tap an option to check your answer.
Correct answer: Push the Docker images to an Amazon ECR repository and enable a local Docker layer cache for CodeBuild builds..
Why this is the answer
Pushing Docker images to Amazon ECR and enabling a local Docker layer cache for CodeBuild is the most effective solution. CodeBuild's Docker layer caching feature reuses layers from previous builds stored in ECR, significantly speeding up subsequent builds and reducing build duration costs. This approach is managed directly by CodeBuild, minimizing operational effort. Caching Docker images in an S3 bucket is not a native or efficient way to manage Docker layer caching for CodeBuild. Storing images in ECR and always pulling the latest version doesn't leverage layer caching; it pulls the entire image every time. Creating custom AMIs with cached images is high operational overhead and doesn't provide dynamic layer caching for frequently changing images.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed