-
Notifications
You must be signed in to change notification settings - Fork 32
Explore ways to trim down the image size #9
Comments
For the record, I'm -1 on point 3, +1 on the rest (if testing shows real savings). |
FWIW, I'm only +1 on point 3 for the slim variant -- in the default image I definitely agree that they ought to be there, and I'd actually highly recommend you stick to the fat |
I am 👍 atm for 3. Use case:
You don't always want to run |
My main objection is that this would change the provided functionality of the Can we instead introduce a new variant, e.g. |
Please don't introduce a new variant. It's not supposed to be a 100% drop-in replacement for the default variant. What we're discussing is what the "slim" variant was supposed to be from the beginning. |
In that case I change my -1 to 0 😐 |
It could be that some of my Node assumptions are wrong: aren't there a huge |
To clarify a little bit: the slim variants are intentionally supposed |
(So if it's reasonable for a user to create a Node application that |
yes, that's a reasonable assumption, it's safe to say that if you are using compiled/native addons for Node.js then you're probably used to shaving a few yaks so it shouldn't a problem to have Docker images that don't support that out of the box, particularly if they are labelled "slim" |
So to summarize where we are here, we want to remove Still exploring reducing the size of
|
Will open a pull request with a revised version of |
Here's a project that did something similar for old node.js https://github.com/jprjr/docker-tinynode. He got his image down to ~30 MB. Then you can imagine a much faster on-boarding for demos: → docker run -it --rm iojs:tiny node -p process.versions
{ http_parser: '2.3.0',
node: '1.1.0',
v8: '4.1.0.14',
uv: '1.3.0',
zlib: '1.2.8',
ares: '1.10.0-DEV',
modules: '43',
openssl: '1.0.1k' } |
instead of docker you could move to the unikernel http://osv.io/ it only includes files you need, there's a project for the old node.js code here: https://github.com/cloudius-systems/osv-apps/tree/master/node |
For Node.js some recent-ish work was done to trim down slim that you might want to incorporate:
|
@chorrell we considered doing the same in the past (#10 (comment)), but instead just switched to using |
What is the rationale behind |
@wblankenship you did +1 #19, remember? I guess the rationale is that it is simple, while still being almost minimal. |
Yup, I do. I just want document our thought process so we can reference it moving forward 😄 |
I'm still using the original slim configs for iojs. It's only 289.8 MB, which 409.5 MB smaller than iojs:latest (699.3 MB) and 98.6 MB larger than iojs:slim (191.2 MB). The jessie equivalent would be 384.9 MB I felt stuck between choosing a slim container that isn't compatible with any node-gyp repos vs. an enormous container that's feels bloated with unnecessary dependencies. I'm willing to sacrifice 98.6 MB for the those npm repo's, but not 409.5 MB. Side Question: Is debian:jessie necessary for running iojs? Or is jessie mostly being used for the updated kernal and libraries. I haven't noticed any issues with wheezy - but all the official repos seem to have switched to jessie. Edit: I had multiple libraries dependent on node:slim break a month or so ago without warning, which is why I'm maintaining this build. I know that 'slim' is meant for people that know what they're doing, but I'm not writing C++ modules, I'm just using npm. Unless I'm only using vanilla-JS npm-repo's, there's no reason to use iojs:slim when it's just as easy to build a container from debian's base image. There's no middle ground in the official repos (for iojs or node). |
An easy way forward is to build off of the |
@wblankenship thanks - I think I'll do that. I'm hosting a node-io repo just for debian:wheezy slim. Although this is an issue I fault with node's official repo (which I began using before iojs) - this repo seems to copy their standards - but breaking slim (in node) was unexpected. Switching kernels and removing ggc support was just such a massive breaking change. I'd love to help contribute a 'medium build' for those who don't want the full build-pack, but want the minimal gcc / python libs running out of the box :) |
Actually after building, I noticed that using iojs:slim as a base created an image that's 415.5 MB - while the wheezy:slim version is 289.8 MB - so I'm sticking with wheezy. Maybe jessie's just bigger? But the goal is a slim image that also has python, git, and build essential - wheezy is definitely smaller base to use. edit: I'm also exploring even smaller linux distros :) |
@RnbWd if you have serious space constraints, take a look at building a static iojs executable in a volume in a throw away container (where you can have all your build dependencies installed). Then use an |
Thanks for the tip! My main goal is a minimal container that's capable of |
Closing as the original goals were achieved. Please open separate issues or PRs for new specific opportunities (such as #44). |
Some ideas suggested elsewhere:
buildpack-deps:jessie-micro
build-essential
package might be too fat, as it also brings stuff for Debian package development which we don't need. We may save space by installing only the useful bits.The text was updated successfully, but these errors were encountered: