Skip to content

Commit

Permalink
add dockerfile and running instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
nmlc committed Apr 4, 2022
1 parent 7d11bb8 commit ffb947e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.13.15-alpine3.12 AS build
WORKDIR /app
# COPY go.mod go.sum .
# ^^ add go.sum when you will need modules
COPY go.mod .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o ./out/app .

FROM gcr.io/distroless/static-debian10
COPY --from=build /app/out/app /usr/local/bin/app
ENTRYPOINT ["/usr/local/bin/app"]
8 changes: 8 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
docker run kafka-metrics:latest \
--prometheus-url http://10.130.0.35:9090 \
--partition-size-query 'max(kafka_log_log_size{kafka_cluster="kafka-mailings-dm-stable"}) by (topic,partition)' \
--broker-storage-query 'node_filesystem_avail_bytes{node_group="kafka-mailings-dm-stable", mountpoint=~"/var/lib/kafka.*"}' \
--broker-id-label instance \
--broker-id-map "kafka-mailings-dm-stable-a-1-v1=1,kafka-mailings-dm-stable-a-2-v1=4,kafka-mailings-dm-stable-b-1-v1=2,kafka-mailings-dm-stable-b-2-v1=5,kafka-mailings-dm-stable-c-1-v1=3,kafka-mailings-dm-stable-c-2-v1=6" \
--zk-addr 10.145.0.214:2181 \
--prometheus-query-timeout 300s

0 comments on commit ffb947e

Please sign in to comment.