-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gkarthiks <github.gkarthiks@gmail.com>
- Loading branch information
Showing
1 changed file
with
6 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
# Stage 1: Build executable | ||
FROM golang:1.12-alpine as builder | ||
FROM golang:1.14-alpine as builder | ||
|
||
LABEL maintainer="Karthikeyan Govindaraj <github.gkarthiks@gmail.com>" | ||
|
||
WORKDIR /go/src/github.com/gkarthiks/container-resource-exporter | ||
COPY container_resource_exporter.go . | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
RUN apk update && apk add git ca-certificates && rm -rf /var/cache/apk/* | ||
|
||
#RUN go get -v -t . | ||
RUN set -x && \ | ||
go get github.com/sirupsen/logrus && \ | ||
go get github.com/prometheus/client_golang/prometheus && \ | ||
go get k8s.io/api/core/v1 && \ | ||
go get k8s.io/apimachinery/pkg/apis/meta/v1 && \ | ||
go get k8s.io/client-go/kubernetes && \ | ||
go get k8s.io/metrics/pkg/apis/metrics/v1beta1 && \ | ||
go get k8s.io/metrics/pkg/client/clientset/versioned | ||
RUN go get -v -t . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /cr-exporter | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /cr-exporter . | ||
EXPOSE 9000 | ||
ENTRYPOINT [ "/cr-exporter" ] | ||
ENTRYPOINT [ "/cr-exporter" ] |