-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
21 lines (20 loc) · 920 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM golang:1.11 as builder
ENV GO111MODULE on
ENV GRPC_HEALTH_PROBE_VERSION v0.2.0
WORKDIR /go/src/clustergarage.io/argus-controller/
# Put dependencies in their own layer so they are cached.
COPY go.mod go.sum ./
RUN go mod download
# Build the rest of the code.
COPY . /go/src/clustergarage.io/argus-controller/
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o arguscontroller .
# Include grpc_health_probe for K8s liveness/readiness checks.
RUN wget -qO/bin/grpc_health_probe \
https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
FROM alpine:edge
COPY --from=builder /go/src/clustergarage.io/argus-controller/arguscontroller /
COPY --from=builder /bin/grpc_health_probe /bin/
# glog requires /tmp to exist as log_dir is /tmp by default.
COPY --from=builder /tmp /tmp
CMD ["/arguscontroller"]