Hacker News new | past | comments | ask | show | jobs | submit login

I wonder if it would be possible to do this semi-automatically. Boot it in a VM, check what is actually accessed during boot / a couple programs starting up / running. ("Just" automate this.) Remove the files / parts of files, check that everything still works. If yes, repeat. If no, try binary searching until you get something that does work. Repeat.



Someone got a Linux image that could run `ls` down to 6.12MB by intercepting file accesses and deleting anything unused... See "How I shrunk a Docker image by 98.8%" (https://news.ycombinator.com/item?id=9438323)


It's an overly simple method but a good start. Will work if the dependencies are static and load at runtime. I don't know enough about the tool to say if it works for more dynamic applications.


Nice thinking but I'm not sure it's a great idea. The reason, which I warned tommy, was that there's plenty of code in there for significant situations that are uncommon or even rare. You'd have to pick out about every way you'd configure, run, maintain, and so on a binary program to exercise all its relevant functionality. You'd also have to hit it with various errors to be sure they're within the same libraries. Otherwise, you're risking leaving out something critical and it will be hard to figure out by the time trimming is done.

For this reason, I thought about using Windows Embedded as it has configuration tools to strip out most unnecessary things while being compatible with whatever you want. That plus stripping guides. Alternatively, stick with tommy's stripping-style method. Either way, you eventually have a set of files you turn into an image with proprietary or open tools along with configuration scripts to make it unique. That has many advantages in addition to size in terms of administration, backup, and even security.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: