Multi-stage builds: compile big, ship small
Select an icon to see what it is.
Step 4 of 6
COPY --from takes one file
COPY --from=builder /out/web /web copies that one file from the builder stage into a new layer of the final stage. Nothing else comes across. CMD then sets the start command in the image config.
BuildKit log (illustrative numbers)
#7 [stage-1 2/2] COPY --from=builder /out/web /web