From 71c726871c5e3e4bcc6e671a7c92d85b2c3fd916 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Thu, 19 Jan 2023 11:35:36 -0800 Subject: [PATCH] Use greater_server (#4) --- grpc/Dockerfile | 13 +++++-------- grpc/README.md | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) 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.