4 ms·
I used baseimage-docker for a while but wasn't satisfied with the image size (around 300mb with nodejs installed), so I switched to debian as the base and remov
by Gigablah 12y ago
I used baseimage-docker for a while but wasn't satisfied with the image size (around 300mb with nodejs installed), so I switched to debian as the base and removed stuff I didn't need such as syslog and openssh. That alone brought it down to 140mb.
However seeing as other people have managed to distribute their applications in images as small as 7mb (e.g. progrium/logspout), I decided to create one based on busybox with s6 as the process supervisor, with help from this article [1]. I'm now pretty happy with my 33mb nodejs environment :)
[1]: http://blog.tutum.co/2014/12/02/docker-and-s6-my-new-favorite-process-supervisor/ http://blog.tutum.co/2014/12/02/docker-and-s6-my-new-favorit...
- dypsilon 12y agoSounds very interesting, do you have an image in the docker hub?
- Gigablah 12y agoI'll get around to putting up a GitHub repo soon, but for now you can pull gigablah/busybox-node. You can either override the entrypoint or daemonize it and use docker exec.
- mikepurvis 12y agoI really like this idea, but it really only works for stuff you can build statically. I'm wondering if there's a middle ground— for example, a busybox container which gives you python and pip, or workflow which lets you install a deb and all its dependencies into a container, without the container needing to itself have all the apt machinery and other bootstrap detritus on board.
- Gigablah 12y agoYou can bundle busybox with opkg and use that to install python 2.7 and pip. I tried it out myself (using progrium/busybox [1] as a base) and the image comes to 27mb, not bad. [1]: https://github.com/progrium/busybox https://github.com/progrium/busybox
- mikepurvis 12y agoAh, that's fantastic. Thanks for the pointer!
- zokier 12y agoSounds like somewhat similar than what docker-nano was doing, see e.g. nano/node.js: https://registry.hub.docker.com/u/nano/node.js/ https://registry.hub.docker.com/u/nano/node.js/ docker-nano is based on buildroot which is kinda automated way of doing that