Skip to content
This repository has been archived by the owner. It is now read-only.

node: add slim variant - #19

Merged
tianon merged 5 commits into
docker-library:masterfrom
proppy:master
Oct 9, 2014
Merged

tianon merged 5 commits into
docker-library:masterfrom
proppy:master

Conversation

@proppy

@proppy proppy commented Oct 1, 2014

Copy link
Copy Markdown
$ 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:

  • use wheezy instead of buildpack-deps
  • add --no-install-recommends with more explicit build deps (pkg-config, python)

@tianon

tianon commented Oct 1, 2014

Copy link
Copy Markdown
Member

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

proppy commented Oct 1, 2014

Copy link
Copy Markdown
Author

@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 moby/moby#8240 is accepted, we will have a way to apt-get install headers in :onbuild image without screwing the cache.

@yosifkit

yosifkit commented Oct 1, 2014

Copy link
Copy Markdown
Member

@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

proppy commented Oct 1, 2014

Copy link
Copy Markdown
Author

@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

proppy commented Oct 6, 2014

Copy link
Copy Markdown
Author

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

proppy commented Oct 6, 2014

Copy link
Copy Markdown
Author

rebased.

@proppy proppy changed the title node: slim down images node: add slim variant Oct 6, 2014
@proppy

proppy commented Oct 7, 2014

Copy link
Copy Markdown
Author

added 0.8 slim variant PTAL!

Comment thread update.sh Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just add "$version/slim/Dockerfile" to the end of this line instead of duplicating this whole sed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@tianon

tianon commented Oct 9, 2014

Copy link
Copy Markdown
Member

LGTM

Comment thread 0.10/slim/Dockerfile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a && rm -rf /var/lib/apt/lists/* like golang? Not a blocker, we could still merge this and add the rm to all the variants of node. (ie, LGTM)

@tianon

tianon commented Oct 9, 2014

Copy link
Copy Markdown
Member

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

tianon added a commit that referenced this pull request Oct 9, 2014
@tianon
tianon merged commit 076aa1d into docker-library:master Oct 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants