grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.65k stars 764 forks source link

Echo example does not work on arm64 #666

Closed cfriedt closed 5 years ago

cfriedt commented 5 years ago

https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/echo

docker build -t grpcweb/commonjs-client    -f net/grpc/gateway/docker/commonjs_client/Dockerfile .
Sending build context to Docker daemon   1.62MB
Step 1/8 : FROM grpcweb/common
 ---> a68b8bc92978
Step 2/8 : WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo
 ---> Using cache
 ---> 22fb25450410
Step 3/8 : RUN protoc -I=. echo.proto --js_out=import_style=commonjs:./commonjs-example --grpc-web_out=import_style=commonjs,mode=grpcwebtext:./commonjs-example
 ---> Running in 355160eb393b
/bin/sh: 1: protoc: Exec format error
The command '/bin/sh -c protoc -I=. echo.proto --js_out=import_style=commonjs:./commonjs-example --grpc-web_out=import_style=commonjs,mode=grpcwebtext:./commonjs-example' returned a non-zero code: 2

Everything else seems to work fine up until that point.

stanley-cheung commented 5 years ago

The protoc binary in this docker image was downloaded with the x86_64 variant from the protobuf release page, like this. So it's not expected to work in arm64. I am not sure if they offer a precompiled variant for arm64. In any case this docker image is meant to just demonstrate how generally things work with grpc-web. For variants like this you may need to do a bit more work to make that work. I personally haven't tried to compile everything in arm64 unfortunately.

cfriedt commented 5 years ago

Oh - they do offer a precompiled protoc binary