-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use container ID instead of pod UID when getting info from docker
This PR also simplifies the Makefile and Dockerfile and makes use of a multi stage build process.
- Loading branch information
Showing
6 changed files
with
74 additions
and
74 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
vendor/ |
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,8 +1,22 @@ | ||
FROM golang:1.11 | ||
|
||
WORKDIR /go/src/github.com/sapcc/kuberntes-oomkill-exporter | ||
ENV GO111MODULE=on \ | ||
CGOENABLED=0 | ||
ADD go.mod go.sum ./ | ||
RUN go mod download | ||
ADD cache/main.go . | ||
RUN go build -v -o /dev/null | ||
ADD . . | ||
RUN go build -v -o /kubernetes-oomkill-exporter | ||
RUN go test -v | ||
RUN go vet | ||
|
||
FROM alpine:3.8 | ||
LABEL maintainer="[email protected]" | ||
|
||
RUN apk --no-cache add ca-certificates | ||
COPY kubernetes-oomkill-exporter /kubernetes-oomkill-exporter | ||
COPY /kubernetes-oomkill-exporter /kubernetes-oomkill-exporter | ||
|
||
ENTRYPOINT ["/kubernetes-oomkill-exporter"] | ||
CMD ["-logtostderr"] |
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//This file is only used to speedup the docker build | ||
//We use this to download and compile the go module dependencies before adding our own source code. | ||
//See Dockerfile for more details | ||
|
||
package main | ||
|
||
import ( | ||
_ "flag" | ||
_ "net/http" | ||
_ "regexp" | ||
_ "strings" | ||
|
||
_ "docker.io/go-docker" | ||
_ "docker.io/go-docker/api/types" | ||
_ "github.com/golang/glog" | ||
_ "github.com/prometheus/client_golang/prometheus" | ||
_ "github.com/prometheus/client_golang/prometheus/promhttp" | ||
_ "golang.org/x/net/context" | ||
_ "k8s.io/node-problem-detector/pkg/systemlogmonitor/logwatchers/kmsg" | ||
_ "k8s.io/node-problem-detector/pkg/systemlogmonitor/logwatchers/types" | ||
) | ||
|
||
func main() { | ||
|
||
} |
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
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