Skip to content

Slimmer slim variants and a few consistency fixes #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2015

Conversation

tianon
Copy link
Contributor

@tianon tianon commented Jan 22, 2015

This removes almost all of the dependencies from the slim variant. The rationale for this is that the slim variants are intentionally supposed to be for people who really know what they're doing and want to create an image that's as small as is reasonably possible for their very specific use case (meaning that if they want to be able to, for example, npm install native modules, they'll need to know which packages that requires), where the normal variant is supposed to be as generic as possible for the majority of use cases (hence why it is FROM buildpack-deps -- see https://registry.hub.docker.com/_/buildpack-deps/ for more information about that and what's included there).

This also updates FROM buildpack-deps to be the more explicit (but currently equivalent) FROM buildpack-deps:jessie, and updated the slim variants to use debian:jessie instead of debian:wheezy so that they all have the same base underneath.

$ docker images node
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
node                0.8-slim            3c0b9c2ee34f        4 hours ago         286.3 MB
node                0.8                 45c9764d3191        4 hours ago         704.1 MB
node                0.11-slim           869731dd5c7f        4 hours ago         296.2 MB
node                0.11                c26e7af3ade7        4 hours ago         714 MB
node                0.10-slim           af6b79e3e7dd        4 hours ago         287.3 MB
node                0.10                9787c55efe92        4 hours ago         705 MB
$ ./generate-stackbrew-library.sh | sed 's!joyent/docker-node!infosiftr/node!' > node
$ bashbrew build ./node
Fetching node (git://github.com/infosiftr/node) ...
Processing node:0.10.35 ...
...
Processing node:0.8-slim ...
$ docker images node
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
node                0.8-slim            ef20a87f7564        39 seconds ago      149.3 MB
node                0.8                 a62c349fcfbd        2 minutes ago       694.6 MB
node                0.11-slim           9cf495665fa1        3 minutes ago       159.2 MB
node                0.11                9671c6b7befe        6 minutes ago       704.5 MB
node                0.10-slim           eda61ceff5e2        7 minutes ago       150.3 MB
node                0.10                2895ad48803c        10 minutes ago      695.6 MB

ca-certificates \
curl
curl \
&& rm -rf /var/lib/apt/lists/*

This comment was marked as off-topic.

This comment was marked as off-topic.

This removes almost all of the dependencies from the slim variant.  The rationale for this is that the slim variants are intentionally supposed to be for people who really know what they're doing and want to create an image that's as small as is reasonably possible for their very specific use case (meaning that if they want to be able to, for example, `npm install` native modules, they'll need to know which packages that requires), where the normal variant is supposed to be as generic as possible for the majority of use cases (hence why it is `FROM buildpack-deps` -- see https://registry.hub.docker.com/_/buildpack-deps/ for more information about that and what's included there).

This also updates `FROM buildpack-deps` to be the more explicit (but currently equivalent) `FROM buildpack-deps:jessie`, and updated the slim variants to use `debian:jessie` instead of `debian:wheezy` so that they all have the same base underneath.

```console
$ docker images node
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
node                0.8-slim            3c0b9c2ee34f        4 hours ago         286.3 MB
node                0.8                 45c9764d3191        4 hours ago         704.1 MB
node                0.11-slim           869731dd5c7f        4 hours ago         296.2 MB
node                0.11                c26e7af3ade7        4 hours ago         714 MB
node                0.10-slim           af6b79e3e7dd        4 hours ago         287.3 MB
node                0.10                9787c55efe92        4 hours ago         705 MB
$ ./generate-stackbrew-library.sh | sed 's!joyent/docker-node!infosiftr/node!' > node
$ bashbrew build ./node
Fetching node (git://github.com/infosiftr/node) ...
Processing node:0.10.35 ...
...
Processing node:0.8-slim ...
$ docker images node
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
node                0.8-slim            ef20a87f7564        39 seconds ago      149.3 MB
node                0.8                 a62c349fcfbd        2 minutes ago       694.6 MB
node                0.11-slim           9cf495665fa1        3 minutes ago       159.2 MB
node                0.11                9671c6b7befe        6 minutes ago       704.5 MB
node                0.10-slim           eda61ceff5e2        7 minutes ago       150.3 MB
node                0.10                2895ad48803c        10 minutes ago      695.6 MB
```
@proppy
Copy link

proppy commented Jan 26, 2015

As someone who contributed to the slim version, I think there might be a simpler change:
We could have the default version depends on buildpack-scm + gcc and remove the slim version altogether.

The slim version was originally created to balance with buildpack-deps including a lot (300+MB) of dependencies only to make the :onbuild works with native deps. I think having a default variant that is smaller (< 400MB) but still contains scm tools and a native toolchain is more desirable.

@tianon
Copy link
Contributor Author

tianon commented Jan 26, 2015

I'm still very much +1 on the slim variant existing, especially since there are things you'd expect from a standard "node" base image that aren't always required (like compilers for native modules, for example).

For those interested in the heated IRC debate between @proppy and I, it starts at https://botbot.me/freenode/docker-library/msg/30500081/.

@chorrell
Copy link
Contributor

Why the switch to jessie? I'd prefer to have that as a separate change and keep this focused on slimming down slim.

We can switch to jessie when it's moved to "stable" (it's currently still in "testing")

@tianon
Copy link
Contributor Author

tianon commented Jan 28, 2015

This doesn't include a switch to jessie. You're already on jessie.

@tianon
Copy link
Contributor Author

tianon commented Jan 28, 2015

Note https://registry.hub.docker.com/_/buildpack-deps/:

jessie, latest (jessie/Dockerfile)

@tianon
Copy link
Contributor Author

tianon commented Jan 28, 2015

I've just updated slim to match the main image.

@yosifkit
Copy link
Contributor

buildpack-deps:latest is currently jessie, I think this change was to bring the slim version in line with the regular.

@tianon
Copy link
Contributor Author

tianon commented Jan 28, 2015

Also, Jessie is currently in freeze, so it's not going to change a whole lot before the stable release.

@chorrell
Copy link
Contributor

Oh, ok, I didn't realize buildpack-deps:latest defaulted to jessie. Makes sense now.

@chorrell
Copy link
Contributor

OK, LGTM. I also like the additional cleanup in the main dockerfiles to remove the redundant installation of ca-certificates and curl 👍

chorrell added a commit that referenced this pull request Jan 30, 2015
Slimmer slim variants and a few consistency fixes
@chorrell chorrell merged commit 01fe973 into nodejs:master Jan 30, 2015
@chorrell chorrell mentioned this pull request Jan 30, 2015
@tianon tianon deleted the slimmer-slim branch January 30, 2015 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants