Created
November 15, 2021 20:28
-
-
Save madchap/6a8dfdcc366cf6c1b18a777080b1c52e to your computer and use it in GitHub Desktop.
Hello gRPC server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.17 AS builder | |
RUN apt-get update && apt-get install -y --no-install-recommends git; \ | |
rm -rf /var/lib/apt/lists/* | |
WORKDIR $GOPATH/src/helloworld | |
RUN git clone -b v1.41.0 https://github.com/grpc/grpc-go | |
WORKDIR grpc-go/examples/helloworld/greeter_server | |
RUN go mod init | |
RUN go get -d -v | |
RUN CGO_ENABLED=0 go build -o /go/bin/greeter_server | |
RUN ls -l /go/bin/greeter_server | |
FROM scratch | |
COPY --from=builder /go/bin/greeter_server /go/bin/greeter_server | |
ENTRYPOINT ["/go/bin/greeter_server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment