Re:Dockerception: Docker building dockers – keeping them small
by falcolas on Monday April 06, 2015 @06:27PM
(#9331069)
If you really want to keep your container images small, omit the base image entirely.
Make a folder with your app, identify and hardlink its dependencies into that folder, and stream the tar of that folder into Docker. No bash, no kernel, no /usr/bin, no binaries, libraries or files of any kind that you don't explicitly need.
It's a method that has been used for years in creating chroot environments, and it works for containers as well. It does require a bit more knowledge than `apt-get install`, however.
Make a folder with your app, identify and hardlink its dependencies into that folder, and stream the tar of that folder into Docker. No bash, no kernel, no /usr/bin, no binaries, libraries or files of any kind that you don't explicitly need.
It's a method that has been used for years in creating chroot environments, and it works for containers as well. It does require a bit more knowledge than `apt-get install`, however.