Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Import error trying to run gRPC on alpine #6126
Hi, I am trying to run a gRPC server inside of a docker container and I am receiving the error:
My docker file is:
I am installing gRPC from PYPI and would not expect any other dependencies?
@bbassingthwaite-va Have you tried installing
Adding a comment as found this error via Google and the solution worked for me. Had the same error, slightly different trace - but ultimately resolved by installing the
My tracelog for reference:
added a commit
Nov 19, 2016
I'll admit I scratched my head when I first encountered this but I don't put the onus on the gRPC team to create builds for every exotic libc implementation people can conjure up.
Alpine is very forthcoming with the use of musl libc. I think the onus is on us to understand what that means to the code we are trying to run.
In this case it means we need to install a compatibility shim
Alpine has an excellent tool for getting to the bottom of these issues https://pkgs.alpinelinux.org/contents
For example you can find what, if any, packages may offer the missing
I just spun up the alpine docker image we use for testing
I pip installed grpc, and was able to import grpc without running into the issue described above.
To make sure we didn't transitively pull in libc6-compat into our alpine docker image, I did
I agree in general that supporting other libc implementations is not necessarily a good idea, but in this case Alpine is quickly becoming the de facto Docker images base OS.
While I do agree that the fix is easy, understanding why it doesn't work can be painful as demonstrated by the quantity of issues related to Alpine in this repo (and any other large project that doesn't support musl).
Also note that I have no idea of the effort required to implement this directly in gRPC. I simply think it should at least be in the roadmap.
Indeed it seems that the
I will open a PR there. Sorry for reviving this old thread!