-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
ca-certificates \ | ||
curl | ||
curl \ | ||
&& rm -rf /var/lib/apt/lists/* |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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 ```
As someone who contributed to the slim version, I think there might be a simpler change: The slim version was originally created to balance with buildpack-deps including a lot (300+MB) of dependencies only to make the |
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/. |
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") |
This doesn't include a switch to jessie. You're already on jessie. |
Note https://registry.hub.docker.com/_/buildpack-deps/:
|
I've just updated |
|
Also, Jessie is currently in freeze, so it's not going to change a whole lot before the stable release. |
Oh, ok, I didn't realize buildpack-deps:latest defaulted to jessie. Makes sense now. |
OK, LGTM. I also like the additional cleanup in the main dockerfiles to remove the redundant installation of ca-certificates and curl 👍 |
Slimmer slim variants and a few consistency fixes
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 isFROM 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 usedebian:jessie
instead ofdebian:wheezy
so that they all have the same base underneath.