docker-library / node

DEPRECATED; image taken over by Node upstream
https://github.com/joyent/docker-node
MIT License
81 stars 36 forks source link

node: add slim variant #19

Closed proppy closed 10 years ago

proppy commented 10 years ago
$ docker images node
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
node                0.10                ae023fecd24f        3 days ago          714.9 MB
$ docker images proppy/node
REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
proppy/node         0.10                b50f869976fa        About a minute ago   294.9 MB

Main changes are:

tianon commented 10 years ago

Aren't there a fair number of Node modules that do require development headers? I think in my testing I ran into a few, but I don't recall for certain.

I'm definitely in favor of node:slim variations, but I think the jury is still out on whether that's a reasonable default and I need some convincing.

proppy commented 10 years ago

@tianon maybe we could write something against the npm API that try to :onbuild and see which one fails :)

If we found out that some headers are used by a majority of packages (I suspect the set will be different from language like ruby), we could always add them to the node base instead of buildpack-deps so it doesn't bloat every downstream images.

In addition, when and if https://github.com/docker/docker/issues/8240 is accepted, we will have a way to apt-get install headers in :onbuild image without screwing the cache.

yosifkit commented 10 years ago

@proppy what do you mean with "write something against the npm API that try to :onbuild and see which one fails"? Do want to check all the npm installable packages for external dependencies?

The extra benefit of the buildpack-deps image is deduplication on servers running multiple languages, like ruby, node, and python.

I suggest we start making :slim versions that contain the minimal to run the language.

proppy commented 10 years ago

@proppy what do you mean with "write something against the npm API that try to :onbuild and see which one fails"? Do want to check all the npm installable packages for external dependencies?

Yes, I though it'be interesting to probe the npm archive for external dependencies through its API (if such a thing exists).

The extra benefit of the buildpack-deps image is deduplication on servers running multiple languages, like ruby, node, and python.

But it does come at the cost of a few hunders MB.

I'd argue that most of the :onbuild deelopers for nodejs will be pure javascript web app and won't benefit from those headers much. (If you do need the headers, it is simple enough to base your image on FROM node and do the apt-get install yourself, similarly to what you suggested on #14),

proppy commented 10 years ago

PTAL refactored the change to create a slim variant, instead of modifying the default.

We can then discuss what should be the default for FROM node in another thread.

proppy commented 10 years ago

rebased.

proppy commented 10 years ago

added 0.8 slim variant PTAL!

tianon commented 10 years ago

LGTM

tianon commented 10 years ago

Fair @yosifkit; let's make a new PR to add that to "all the things" :smile: