File tree Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1- FROM golang:1.14.4-alpine3.12 as build
1+ FROM golang:1.16.1-buster as build
22
3- # Get prebuilt libkafka.
4- RUN apk add --no-cache alpine-sdk 'librdkafka>=1.3.0' 'librdkafka-dev>=1.3.0'
3+ RUN apt update && apt install build-essential -y
54
65WORKDIR /src/prometheus-kafka-adapter
7- ADD . /src/prometheus-kafka-adapter
86
9- RUN go test
10- RUN go build -o /prometheus-kafka-adapter
7+ COPY go.mod .
8+ COPY go.sum .
9+ RUN go mod download
10+
11+ ADD . /src/prometheus-kafka-adapter
1112
12- FROM alpine:3.12
13+ RUN go build -o /prometheus-kafka-adapter -ldflags '-w -extldflags "-static"'
14+ RUN go test ./...
1315
14- RUN apk add --no-cache 'librdkafka>=1.3.0'
16+ FROM alpine:3.13
1517
16- COPY --from=build /src/prometheus-kafka-adapter/ schemas/metric.avsc /schemas/metric.avsc
18+ COPY schemas/metric.avsc /schemas/metric.avsc
1719COPY --from=build /prometheus-kafka-adapter /
1820
1921CMD /prometheus-kafka-adapter
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ Building requires librdkafka be available on the building host. It is typically
8282
8383` ` `
8484go test
85- go build -tags static
85+ go build
8686` ` `
8787
8888# # contributing
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ require (
44 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
55 github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
66 github.com/beorn7/perks v1.0.1 // indirect
7- github.com/confluentinc/confluent-kafka-go v1.3.0
7+ github.com/confluentinc/confluent-kafka-go v1.6.1
88 github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607
99 github.com/gin-gonic/gin v1.6.3
1010 github.com/gogo/protobuf v1.3.1
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
66github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM =
77github.com/beorn7/perks v1.0.1 /go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw =
88github.com/client9/misspell v0.3.4 /go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw =
9- github.com/confluentinc/confluent-kafka-go v1.3.0 h1:1gJm/SgUqG01jRYJ1pSZ9GldAhXZ0xrFPKxINlVZ3z0 =
10- github.com/confluentinc/confluent-kafka-go v1.3.0 /go.mod h1:MPUvNqmycSJrQZKGPS6LyLZLJH1hmLKkBmHQgQR7Ma0 =
9+ github.com/confluentinc/confluent-kafka-go v1.6.1 h1:YxM/UtMQ2vgJX2gIgeJFUD0ANQYTEvfo4Cs4qKUlmGE =
10+ github.com/confluentinc/confluent-kafka-go v1.6.1 /go.mod h1:u2zNLny2xq+5rWeTQjFHbDzzNuba4P1vo31r9r4uAdg =
1111github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
1212github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
1313github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
You can’t perform that action at this time.
0 commit comments