A developer is using AWS CodeBuild to build a Java application. The buildspec.yml file includes commands to run unit tests and package the application. Recently, the build started failing with the error 'No space left on device.' The developer notices that the build environment is using the general1.large compute type with 8 GB of disk space. The developer needs to resolve the disk space issue without modifying the application code. The build environment is managed by CodeBuild and the developer cannot change the instance type. What should the developer do?
Cleaning the cache frees up disk space, resolving the 'No space left on device' error.
Why this answer
Option D is correct because cleaning up the cache before building frees up disk space. Option A is wrong because CodeBuild does not allow mounting EBS volumes. Option B is wrong because EFS cache is not supported.
Option C is wrong because the instance type cannot be changed. The error is due to disk space exhaustion, and clearing the cache resolves it.