3 ms·
The other day, for testing purposes, I managed to make a minimal docker container with the smallest 'exit 0' binary I could make without any serious trickery, j
by mmagin 9y ago
The other day, for testing purposes, I managed to make a minimal docker container with the smallest 'exit 0' binary I could make without any serious trickery, just gcc -static -s -Os, and was kind of embarrassed that it took 840 kB.
(I realize there are ways to get this down to probably the sub-1kB level, but I wanted something I could generate reliably on the fly in a shell script, so...)
- tadfisher 9y agoThe problem is glibc: https://github.com/lattera/glibc/blob/master/stdlib/exit.c https://github.com/lattera/glibc/blob/master/stdlib/exit.c And by extension, the rather complex set of POSIX exit() semantics: http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html http://pubs.opengroup.org/onlinepubs/000095399/functions/exi... Using something like musl should save you some bloat, or simply call "return 0;" instead of exit().