ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 82 - DCA discussion

Report
Export

Is this an advantage of multi-stage builds?

Solution: optimizes Images by copying artifacts selectively from previous stages

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: A

Explanation:

Multi-stage builds are a feature of Docker that allows you to use multiple FROM statements in your Dockerfile. Each FROM statement creates a new stage of the build, which can use a different base image and run different commands. You can then copy artifacts from one stage to another, leaving behind everything you don't want in the final image. This optimizes the image size and reduces the attack surface by removing unnecessary dependencies and tools. For example, you can use a stage to compile your code, and then copy only the executable file to the final stage, which can use a minimal base image like scratch. This way, you don't need to include the compiler or the source code in the final image.Reference:

Multi-stage builds | Docker Docs

What Are Multi-Stage Docker Builds? - How-To Geek

Multi-stage | Docker Docs

asked 08/11/2024
João Faria
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first