diff --git a/grpc/Dockerfile b/grpc/Dockerfile index 8f7955e..d5b310a 100644 --- a/grpc/Dockerfile +++ b/grpc/Dockerfile @@ -1,13 +1,10 @@ # syntax=docker/dockerfile:1.5 FROM golang:1.19 as builder -RUN git clone https://github.com/grpc/grpc-go.git - -WORKDIR /go/grpc-go/examples/route_guide/server - -RUN sed -i -e 's/localhost//g' server.go -RUN CGO_ENABLED=0 go build -o /grpc_server server.go +RUN GO111MODULE=off go get google.golang.org/grpc/examples/helloworld/greeter_server +WORKDIR /go/src/google.golang.org/grpc/examples/helloworld/greeter_server +RUN CGO_ENABLED=0 go build -o /greeter_server FROM scratch -COPY --from=builder /grpc_server / -CMD ["/grpc_server"] +COPY --from=builder /greeter_server / +CMD ["/greeter_server"] diff --git a/grpc/README.md b/grpc/README.md index 9c3d9e9..060b2d1 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -1,5 +1,5 @@ # gRPC Server -From https://github.com/grpc/grpc-go/tree/master/examples/route_guide +From https://github.com/grpc/grpc-go/tree/master/examples/helloworld/greeter_server -The server runs on port 10000. +The server runs on port 50051.