I don't think there is any way to prove that this found all the required files. The more paths through the code, each with its own potential file accesses that can't be predicted with out run time information, the more likely one will be missed in this optimization stage.
Variation on the halting problem? Given infinite running time and arbitrary input, can you prove that a program will never access file X.
How I shrunk a Docker image by 98.8% – featuring fanotify
31–40 of 51 posts
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#32Earlier quoted context omitted.
Any Unix-ish application (i.e. one that shells out to do something at some point) will have a package dependency tree that ends up transitively closing over the "base"/"essential" package-set of the OS. "Dependency" has three meanings, to a packaging system, even though at run-time only one of them is relevant. There are: 1. "run-time dependencies" — package B needs package A installed because a binary from B actuall…
I beg to differ, but we can probably compare data points until the cows come home. Anyhow, even a large-ish application such as Oracle or a control system doesn't actually use ping or dd or troff, or most parts of what a modern unix-OS is comprised of. Most things suid are usually unnecessary, which if nothing else does decrease the attack surface. Most web apps probably needs nothing unix-ish at all. A chrooted PHP…
If you can manage to get a working install of Postgres without pulling in half of Debian, I would be surprised.
But yes, on the other hand, it's perfectly possible to package some things, like the JVM, in a sort of "spread-out in a directory but equivalent to static-linked" fashion. The sort of things you see telling you up "unzip them into /opt/thispkg" because they don't really follow any Unix idioms at all, tend to be surprisingly container-friendly. They come from a world where binaries are expected to be portable across systems with different versions of OS libraries available, rather than a world where each app gets to ask the OS to install whatever OS library versions it requires.
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#33Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#34Isn'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…
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#35Isn'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…
Any Unix-ish application (i.e. one that shells out to do something at some point) will have a package dependency tree that ends up transitively closing over the "base"/"essential" package-set of the OS. "Dependency" has three meanings, to a packaging system, even though at run-time only one of them is relevant. There are: 1. "run-time dependencies" — package B needs package A installed because a binary from B actuall…
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#36I don't think there is any way to prove that this found all the required files. The more paths through the code, each with its own potential file accesses that can't be predicted with out run time information, the more likely one will be missed in this optimization stage.
Variation on the halting problem? Given infinite running time and arbitrary input, can you prove that a program will never access file X.
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#37I don't think there is any way to prove that this found all the required files. The more paths through the code, each with its own potential file accesses that can't be predicted with out run time information, the more likely one will be missed in this optimization stage.
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#38I don't think there is any way to prove that this found all the required files. The more paths through the code, each with its own potential file accesses that can't be predicted with out run time information, the more likely one will be missed in this optimization stage.
Variation on the halting problem? Given infinite running time and arbitrary input, can you prove that a program will never access file X.
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#39I don't think there is any way to prove that this found all the required files. The more paths through the code, each with its own potential file accesses that can't be predicted with out run time information, the more likely one will be missed in this optimization stage.
You have runtime information though. It's true that this method will not find all things (dlopened files in strange codepaths), but just like we have tools that can verify 100% code coverage in tests, you could fuzz inputs until you find that you've hit every single branch of the executable's instructions and record all dependencies as you go. You could argue that that can still be fooled by, e.g., making the softwar…
Re: How I shrunk a Docker image by 98.8% – featuring fanotify
#40Earlier quoted context omitted.
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...
You can't make a truly static binary with glibc, so almost no one has a toolchain that is able to do it.