Clean-up docker images / further optimise
Closed this issue · 5 comments
The images for building release candidates are super big. @willcl-ark mentioned this has something to do with not using the guix-build, but i feel like we can get them much smaller. If we can get them down to a reasonable size, we can forgo the whole "downloading from bitcoincore.org" thing and just rely on the github repo.
I am not exactly sure how it works, but fanquake def told me that it's a pain to get the smaller size, and not needing to re-install dynamic libs (which you have still had to do here) without essentially doing the guix build.
After a guix build AFAIK you can not install those deps, which make up 99% of the additional size, and just grab the binary tarball, extract and go!
We can see their config options and steps here: https://github.com/bitcoin/bitcoin/blob/9d594ed1d88ad4aad3dda4ff62acad61f060fe99/contrib/guix/libexec/build.sh#L213-L432
doing the guix build.
tbh, i’m not opposed to doing the guix build.. we should only be making these images once, and only adding new ones every 6ish months.. so seems fine? but again, only necessary if we need to keep the IsRoutable patch, or want to support patches in general
Well, once also for each (custom) built branch too. But still, doing guix build (i.e. depends and core) for say, 1-2 architectures isn't going to take that much longer than a regular build.
I still think we should be able to (relatively) easily extract the guix build steps (and config options) into our own builds script, and forgo the whole guix setup, specifically bootstrapping the whole guix time machine environment thingy from source, which AFAIU is only important for reproducibility and takes a large amount of the extra guix time.
We can try running strip <binary>
to get a quick binary size reduction of ~80% usually.
Note that this removes debugging symbols, I think. This may be usful to some people in some cases...?