AWS Certified Developer – Associate — Question 271
A developer is preparing a containerized application for deployment to AWS Lambda. The developer wants to build and optimize the container images to reduce duplicate work and improve build, deploy, and update times.
Which combination of steps should the developer take to meet these requirements? (Choose two.)
Answer options
- A. Use an AWS provided base image.
- B. Use the smallest compatible third-party base image.
- C. Build frequently changing layers in the imago first, followed by stable layers.
- D. Store images for functions with large layers in the same Amazon Elastic Container Registry (Amazon ECR) repository.
- E. Maximize the number of layers in the built image.
Correct answer: A, D
Explanation
Using an AWS-provided base image ensures compatibility and optimizes performance because these images are cached by AWS Lambda, reducing cold start times and build overhead. Storing images that share large layers in the same Amazon ECR repository allows for layer reuse, which speeds up subsequent deployments and updates by avoiding redundant uploads. Conversely, placing frequently changing layers first or maximizing the number of layers defeats the caching mechanisms of Docker.