Simple question, to docker image is over 600MB seams bit excessive. If I build my now image based on Debian then it is a bit over 200MB (where my Dockerfile is not optimized).
How come such big image?
The main image is based buildpack-deps:jessie which is where most of the size comes from. Historically that base layer was chosen to make it easier for consumers to get started since a lot of dependencies are installed so most npm packages etc. should install without issue.
Over time it became obvious that most consumers cared more about the image size than having a lot of libraries etc installed, so that's why we now have the node:slim and node:alpine variants which are much more reasonable in size.
You'll find that the node:slim image is around the same size your custom Debian image and that's what I'd recommend using. Actually, I would recommend pinning to a major version to avoid any surprises, like use node:4-slim or node:6-slim etc.
Perfect, thank you your explanation :)
Most helpful comment
The main image is based
buildpack-deps:jessiewhich is where most of the size comes from. Historically that base layer was chosen to make it easier for consumers to get started since a lot of dependencies are installed so most npm packages etc. should install without issue.Over time it became obvious that most consumers cared more about the image size than having a lot of libraries etc installed, so that's why we now have the
node:slimandnode:alpinevariants which are much more reasonable in size.You'll find that the
node:slimimage is around the same size your custom Debian image and that's what I'd recommend using. Actually, I would recommend pinning to a major version to avoid any surprises, like usenode:4-slimornode:6-slimetc.