Skip to content

Commit

Permalink
chore: support grpc-ping-go multiple architecture
Browse files Browse the repository at this point in the history
Signed-off-by: kahirokunn <[email protected]>
  • Loading branch information
kahirokunn committed Jul 13, 2023
1 parent 2dd400e commit 57c4354
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code-samples/serving/grpc-ping-go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# https://hub.docker.com/_/golang
FROM golang as builder

ARG TARGETOS
ARG TARGETARCH

# Copy local code to the container image.
WORKDIR /go/src/github.com/knative/docs/code-samples/serving/grpc-ping-go
COPY . ./
Expand All @@ -26,8 +29,8 @@ 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
RUN CGO_ENABLED=0 go build -tags=grpcping -o ./ping-client ./client
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -tags=grpcping -o ./ping-server
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -tags=grpcping -o ./ping-client ./client

# Use a Docker multi-stage build to create a lean production image.
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
Expand Down

0 comments on commit 57c4354

Please sign in to comment.