Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The NodeJS alpine base image is only 40 MB.


Then you _npm install_ something, and BOOOM! 600MB !


You can use multi-stage builds [1] so your result image would be as small as possible by just copying the compiled JS from the build stage.

[1]: https://docs.docker.com/develop/develop-images/multistage-bu...


You still need to download hundreds of megabytes of packages, unpack those into gigabyte of storage, "compile" it into a final form.

Also you need to keep those huge images, if you want to have any reasonable caching. Otherwise builds will take forever.


Compiled JavaScript?


Bundled. With esbuild, for example.


My bad, I meant "bundled".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: