1. 9
  1. 2

    It seems like a slightly unfair comparison of size in the end, when the original image installed Git with RUN apk update && apk add git, while that it left out in the multi-stage builds. From what I can see from a simple test, that accounts for 17 MB of the 21/25 MB difference noted in the article.

    1. 2

      I think that’s the entire point of the article? Using one stage where you don’t give a fuck about the size and then you only care about the final stage size…

      1. 1

        Sure, but adding extra - seemingly unnecessary - dependencies to the “before” example and removing them in the “after” example, without any mention of why they were there in the first place or why they are unnecessary afterwards doesn’t make for a good comparison. Especially when the vast majority of the size difference comes from this one line being absent in the final solution.

        1. 1

          Oh I see what you mean, you’re saying git was never even needed in the development build.

          Fwiw I think the article may have been updated since you posted because I don’t see git being installed in any Dockerfiles

          1. 1

            It has indeed!