Fix gRPC sample Dockerfile (#4967)

This commit is contained in:
Kenjiro Nakayama 2022-05-23 22:39:03 +09:00 committed by GitHub
parent b80b572a88
commit 7eab64dc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -15,15 +15,15 @@
# Use the official Golang image to create a build artifact.
# This is based on Debian and sets the GOPATH to /go.
# https://hub.docker.com/_/golang
FROM golang:1.13 as builder
# Retrieve the dependencies.
RUN go get google.golang.org/grpc
FROM golang as builder
# Copy local code to the container image.
WORKDIR /go/src/github.com/knative/docs/code-samples/serving/grpc-ping-go
COPY . ./
RUN go mod init grpc-ping-go
RUN go mod tidy
# Build the command inside the container.
# To facilitate gRPC testing, this container includes a client command.
RUN CGO_ENABLED=0 go build -tags=grpcping -o ./ping-server