Live data from Hacker News

How I shrunk a Docker image by 98.8% – featuring fanotify

blog.jtlebi.fr

11–20 of 51 posts

Re: How I shrunk a Docker image by 98.8% – featuring fanotify

#13
The exact approach described here is very extreme. It's a top-down method with a tool. I find the tool may be of some interest, but I think bottom-up method would be more practical . I have done some experiments with Yocto/OpenEmbedded and about to put that out one day, once I have time to document it ...

Re: How I shrunk a Docker image by 98.8% – featuring fanotify

#14
Reminds me of the method used for the demoscene FPS game .kkrieger which was stored in less than 100kb. They basically played through the game several times and trimmed out any code paths that weren't used in order to get it small enough, using a rudimentary c++ "pretty printer" they wrote that tracked executions of code paths. They had the advantage of being able to alter their code to only use constructs supported by their custom tool. Utlimately, this led to some bugs/features being stripped. An example being they hadn't pressed up in the menu during their runthrough, so you could only navigate downward.

https://fgiesen.wordpress.com/2012/04/08/metaprogramming-for...

Re: How I shrunk a Docker image by 98.8% – featuring fanotify

#15
post #8
post #6

If only there were some way to describe in a few lines of text what an image should contain?

Do Docker images really have to contain an entire bloated Linux distro? Even for Xen, which, as a hypervisor, provides fewer services than Docker, it's possible to write applications which run directly under Xen.

They don't have to, one can run static binary without any problems. It's just that most people keep throwing in a whole distro...

Re: How I shrunk a Docker image by 98.8% – featuring fanotify

#17
post #2

Why not ldd?

I've been playing with a project to do this. The first major obvious problem is anything that uses dlopen won't necessarily get all that it needs.

Yes. Grepping the code or fighting runtime errors are two complementary approaches I can think of... Not sure if there are other methods.

Re: How I shrunk a Docker image by 98.8% – featuring fanotify

#19
Isn't the point of running an application in a container, or any chrooted environment, to only isolate the application from the rest of the operating system?

Then why would you start out with a complete extra operating system in there? Why not just put the application and its dependencies in there?

To strip non-dependencies from an complete operating system sounds like a very failure prone way to accomplish almost the same thing. You really need to execute all code paths, which is difficult to guarantee (did you really run your application in all locales for example?).

Re: How I shrunk a Docker image by 98.8% – featuring fanotify

#20
post #19

Isn't the point of running an application in a container, or any chrooted environment, to only isolate the application from the rest of the operating system? Then why would you start out with a complete extra operating system in there? Why not just put the application and its dependencies in there? To strip non-dependencies from an complete operating system sounds like a very failure prone way to accomplish almost th…

> Then why would you start out with a complete extra operating system in there? Why not just put the application and its dependencies in there?

Packaging is hard. Let's go shopping!

Post reply on HN