Master Microsoft DevOps Magic 2025 – Turbocharge Your AZ-400 Skills!

Question: 1 / 400

Which Docker container build strategy should you recommend to minimize image sizes while also minimizing the security surface area of the final image?

Multi-stage builds

The recommendation for using multi-stage builds as the Docker container build strategy focuses on several key advantages, especially in terms of minimizing the image size and reducing the security surface area of the final image.

Multi-stage builds allow developers to compile and build their applications in one or multiple stages, while only copying the necessary artifacts to the final image. This process means that development dependencies, build tools, and other unnecessary files are not included in the end product. Consequently, the final image contains only what is essential for running the application, leading to a significantly smaller image size. Smaller images not only make deployments faster but also lead to reduced storage costs and quicker pull times from container registries.

In terms of security, a smaller image with fewer components reduces the attack surface. By excluding extraneous tools and packages that are typically included in a more comprehensive image, the likelihood of vulnerabilities and exploitable items can be greatly diminished. In contrast, single-stage builds incorporate everything into one image, which can lead to larger sizes and increased risk.

PowerShell Desired State Configuration (DSC) and Docker Swarm focus on configuration management and container orchestration, respectively, and are not directly related to the build process of the images. They do not address the specific concerns of minimizing image size

Get further explanation with Examzify DeepDiveBeta

PowerShell Desired State Configuration (DSC)

Docker Swarm

Single-stage builds

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy