SDLC Automation

An AWS CodeBuild project uses a standard AWS-managed Linux image in a VPC to build containers with the Docker daemon and push them to Amazon ECR. Dependency downloads must be cached across builds that run on different hosts; assuming network access and IAM permissions are configured, which project configuration meets these requirements?

Show the answer

Correct answerD. Enable privileged mode and use an Amazon S3 cache for dependency directories.

AWhy not this: Local custom caches remain on a build host and cannot provide dependency reuse across different hosts.

BWhy not this: Docker layer caching is not dependency-directory caching, and CodeBuild local caching is unsupported for VPC builds.

CWhy not this: Docker daemon builds using this managed Linux environment in a VPC require privileged mode.

DWhy this is right: Privileged mode supports the Docker daemon, and S3 caching makes cached dependencies available across build hosts.

Privileged mode supports Docker daemon builds in a VPC, and an S3 cache can restore dependency directories on different build hosts. Local custom caching depends on host reuse and therefore does not satisfy the cross-host requirement.