forked from kserve/kserve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
25 lines (19 loc) · 923 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM golang:1.12 as builder
# Retrieve the dependencies.
RUN go get google.golang.org/grpc
# Copy local code to the container image.
WORKDIR /go/src/helloworld
COPY . ./
# Build the command inside the container.
# To facilitate gRPC testing, this container includes a client command.
RUN CGO_ENABLED=0 go build -tags=grpchelloworld -o ./hello-server
RUN CGO_ENABLED=0 go build -tags=grpchelloworld -o ./hello-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
# https://github.com/GoogleContainerTools/distroless#readme
FROM gcr.io/distroless/static
# Copy the binaries to the production image from the builder stage.
COPY --from=builder /go/src/helloworld/hello-server /server
COPY --from=builder /go/src/helloworld/hello-client /client
# Run the service on container startup.
CMD ["/server"]