Latest release breaks under Alpine
Closed this issue · 6 comments
Is there a reason as to why the latest release (0.5.0) is dynamically linked instead of statically? It breaks Alpine compatibility:
# 0.5.0
/ # file /root/.terraform.d/plugins/terraform-provider-acme
/root/.terraform.d/plugins/terraform-provider-acme: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, with debug_info, not stripped
# 0.4.0
/ # file /root/.terraform.d/plugins/terraform-provider-acme
/root/.terraform.d/plugins/terraform-provider-acme: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped
I know this isn't necessarily a target platform, but it looks like unwanted side-effect to me .. ?
Alpine version used is 3.7.0 (stable).
Hey @moritzheiber, something in the dependency chain more than likely depends on cgo by default, so probably built dynamic by default... this is definitely an oversight and not done intentionally.
For now, you might have to build it by yourself either static or say within Alpine itself (so it links against musl). But I will add this as an enhancement for next release!
No worries, I don't need to rely on the latest release. I'll just stick with 0.4.0 for the time being. Thank you for taking this up.
Hi peepz! I've landed here because I've been a very happy customer of this great terraform provider until I've upgraded to version 0.5.0 and that broke my pipelines (that run on alpine).
I'm not experienced with golang, but I needed to fix my pipelines so I've built the binary for this project in a golang:alpine
container and that worked well.
I'm publishing the linux binary I've built against musl in my fork of this repo under the 0.5.0 tag.
Anyone not wanting to just download a binary off the internet and execute that blindly (would be a smart person and) can build it as well with the following steps:
- clone this repo and cd to it
- run command
docker run --rm -it -v $PWD:/go/src/github.com/vancluever/terraform-provider-acme golang:alpine
- (already in the container) run command
apk add --udpate make git
followed bymake build
- the binary will be available outside the container in the cloned repo directory under
pkg/linux_amd64
.
Hope this helps anyone that lands here looking for it.
I was able to get it working by just installing the "libc6-compat" package in alpine.
I've just found this too. The Hashicorp Docker images run under Alpine so it would be nice to fix this so it works by default.
@viyh's libc6-compat
fix worked for me.
Hey all! This should now be fixed with the 0.6.0 release:
$ ldd ./terraform-provider-acme
not a dynamic executable
Enjoy!