Infrastructure Security

A container build needs a private-package credential and compiler tools, but neither may be recoverable from any layer of the published runtime image. Which build practices meet these requirements? (Choose two.)

Choose 2 answers

Show the answer

Correct answersB. Use a build-time secret mount without copying its contents into image layers.C. Use a multi-stage build that copies only application artifacts into a clean runtime stage.

AWhy not this: Build arguments are not a secure secret channel and can expose values through build metadata or history.

BWhy this is right: A secret mount supplies a temporary build credential without persisting it, provided the build does not copy or expose it.

CWhy this is right: Copying only application artifacts into a clean final stage excludes compiler layers from the runtime image.

DWhy not this: Deleting a credential in a later layer leaves its contents recoverable from the earlier layer.

EWhy not this: Uninstalling tools in a later layer does not remove their contents from preceding image layers.

A multi-stage build keeps compiler layers out of the published runtime image, while a build-time secret mount avoids embedding the credential. Deleting files or uninstalling tools in later layers does not remove their contents from earlier layers.