3 ms·
> And the resulting image is 851MB. If you include the dev dependencies and compiler toolchains in the final image. You can (and should) cut all that out of th
by deathanatos 7y ago
> And the resulting image is 851MB.
If you include the dev dependencies and compiler toolchains in the final image. You can (and should) cut all that out of the final image.
- yjftsjthsd-h 7y agoThe author sort of mentions this: > The image size can be made smaller, for example with multi-stage builds, but that means even more work. ...which I really don't find compelling, honestly. If you want a smaller image, then yes, you need to do one of the major things that produces smaller images. Don't install a whole dev chain, leave it in the image, and then complain that your image is big.
- jrockway 7y agoI think the advice of "ship gcc and its dependencies to production to avoid writing 2 extra lines in your Dockerfile" is pretty awful advice. Less stuff in your containers means faster image pulls and less attack surface. Seems crazy not to do it. FROM clean-image, COPY --from=base-image ... I am guessing with Python the difficulty is in enumerating what files you need to copy, because there's more than one. But I am sure that can be figured out exactly once and you can save yourself some time and money on unnecessary data transfer.