An application development team is migrating their continuous integration process to AWS CodeBuild. The build environment needs to compile a Node.js application, install packages, and build a container image. To optimize build performance, the team wants to cache both the downloaded node modules and the intermediate Docker image layers using local caching on the build host.
Which combination of actions must the developer perform to configure the required caching? (Select TWO.)
- In the buildspec.yml file, add a cache block specifying the path to the node packages (e.g., node_modules/**/*).Cevap
- In the CodeBuild project configuration, enable local cache and select both custom cache and Docker layer cache.Cevap
- CIn the buildspec.yml file, add the /var/lib/docker directory path to the cache block to preserve intermediate container layers.
- DModify the CodeBuild service role's trust policy to allow the Amazon S3 service to write and update cache artifacts.
- EConfigure Systems Manager Parameter Store to store the compressed node package cache, and reference its parameter key in the env block of the buildspec.yml.
Cevap
In the buildspec.yml file, add a cache block specifying the path to the node packages (e.g., node_modules/**/*), and in the CodeBuild project configuration, enable local cache and select both custom cache and Docker layer cache.
To cache custom paths such as dependency folders, the developer must specify the target directory in the buildspec.yml cache block. To use local host caching for both custom buildspec paths and intermediate Docker layers, the developer must also configure local cache in the project settings, explicitly enabling the custom cache and Docker layer cache types.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeBuild Caching Configurations
Tahmini Süre:2m 0s