4 ms·
You're going to have much better luck with an alpine-based docker image. Unfortunately non-musl based systems have a lot of issues with static compilation, so w
by sam0x17 8y ago
You're going to have much better luck with an alpine-based docker image. Unfortunately non-musl based systems have a lot of issues with static compilation, so while this will work with hello world, if you try something more complicated you will likely get linker errors.
- e12e 8y agoParticular to the c library? Because an "ldd" on the hello world listed quite a few libs which all worked fine with a static build.
- sam0x17 8y agoopenssl and libz are particularly fussy
- e12e 8y agoI could definitely see openssl being tricky (libz not so much, but I might very well be naive here) - but how does changing the libc help with either?
- RX14 8y agoglibc has some plugins which make it not easy to statically link. Musl doesn't have that. And alpine compiles openssl etc. with a config amenable to static linking. It's all about distro choices.