nerdexam
Amazon

DOP-C02 · Question #509

A company frequently creates Docker images of an application. The company stores the images in Amazon Elastic Container Registry (Amazon ECR). The company creates both tagged images and untagged…

The correct answer is B. Use Amazon ECR lifecycle policies to delete images based on age or the number of images that. Amazon ECR lifecycle policies are a built-in, managed feature that can automatically expire images based on rules such as image age and can enforce retaining a minimum number of images (for example, keeping the most recent N images). This meets the automatic cleanup and…

Submitted by jaden.t· Mar 6, 2026Configuration Management and IaC

Question

A company frequently creates Docker images of an application. The company stores the images in Amazon Elastic Container Registry (Amazon ECR). The company creates both tagged images and untagged images. The company wants to implement a solution to automatically delete images that have not been updated for a long time and are not frequently used. The solution must retain at least a specified number of images. Which solution will meet these requirements with the LEAST operational overhead?

Options

  • AUse Amazon S3 Lifecycle policies on the ECR repository to automatically delete images based on
  • BUse Amazon ECR lifecycle policies to delete images based on age or the number of images that
  • CConfigure an AWS Lambda function to run a schedule to delete images based on age or the
  • DUse AWS Systems Manager to run a script by using the aws:executeScript action to automatically

How the community answered

(22 responses)
  • B
    86% (19)
  • C
    9% (2)
  • D
    5% (1)

Explanation

Amazon ECR lifecycle policies are a built-in, managed feature that can automatically expire images based on rules such as image age and can enforce retaining a minimum number of images (for example, keeping the most recent N images). This meets the automatic cleanup and minimum-retention requirements without custom code or scheduled jobs, resulting in the least operational overhead.

Topics

#ECR#Image lifecycle#Container images#Cost optimization

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice