Docker-node: Why the Image is so big?

Created on 22 Jan 2017  路  2Comments  路  Source: nodejs/docker-node

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?

Most helpful comment

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.

All 2 comments

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rwillians picture rwillians  路  33Comments

ORESoftware picture ORESoftware  路  20Comments

hjanuschka picture hjanuschka  路  30Comments

dgonzalez picture dgonzalez  路  18Comments

arcanis picture arcanis  路  26Comments