docker-library / busybox

Docker Official Image packaging for Busybox
http://busybox.net
396 stars 127 forks source link

Add "bbconfig" applet to config #57

Closed ryanwoodsmall closed 5 years ago

ryanwoodsmall commented 5 years ago

BusyBox supports a sort of reflective applet called "bbconfig" which will dump the .config used while building the binary. This can be enabled with these config options:

CONFIG_BBCONFIG=y
CONFIG_FEATURE_COMPRESS_BBCONFIG=y

This is a nicety but it's pretty useful when attempting to debug an issue with a container, the binary itself, etc.

tianon commented 5 years ago

Interesting! I did some size comparisons, and here's my results:

Any idea why this isn't enabled by default in defconfig? Do you know whether upstream BusyBox maintainers officially recommend either including it or not including it? (I can't seem to find a lot of good info about it other than it exists. :sweat_smile:)

ryanwoodsmall commented 5 years ago

Upstream is pretty conservative about time/space tradeoffs. Best (only?) documentation is the source, but it doesn't have a ton of reasoning on defaults: https://git.busybox.net/busybox/tree/miscutils/bbconfig.c

tianon commented 5 years ago

In thinking about this more, I'm inclined to think this isn't really worth the additional size (even if it's small), since the things we enable above make defconfig are already quite minimal:

https://github.com/docker-library/busybox/blob/f7661b44becfe763eb1fcb8c176d44f80c742e00/uclibc/Dockerfile.builder#L184-L194

ryanwoodsmall commented 5 years ago

Agreed. Closing. Thanks all!