forked from HO-CTO/sre-monitoring-as-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
9 additions
and
14 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,30 +1,25 @@ | ||
# Builder image to download binaries | ||
FROM golang:1.19.0-alpine3.15 AS builder | ||
FROM golang:1.19.0-alpine3.16 AS builder | ||
|
||
# Download git, jsonnet and jsonnet-bundler | ||
# RUN apk add --no-cache git=2.36.2-r0 curl jq wget && \ | ||
RUN apk add --no-cache git=2.36.2-r0 curl jq wget && \ | ||
go install github.com/google/go-jsonnet/cmd/[email protected] && \ | ||
RUN apk add --no-cache git=2.36.2-r0 && \ | ||
go install github.com/google/go-jsonnet/cmd/[email protected] && \ | ||
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected] | ||
|
||
# Download promtool | ||
RUN VERSION=$(curl -Ls https://api.github.com/repos/prometheus/prometheus/releases/latest | jq ".tag_name" | xargs | cut -c2-) && \ | ||
wget -qO- "https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-$VERSION.linux-amd64.tar.gz" \ | ||
| tar xvzf - "prometheus-$VERSION.linux-amd64"/promtool --strip-components=1 && cp promtool /go/bin/promtool | ||
WORKDIR /go/grafonnet | ||
# Download grafonnet and grafana-builder | ||
RUN jb init && \ | ||
jb install https://github.com/grafana/grafonnet-lib/grafonnet && \ | ||
jb install https://github.com/grafana/jsonnet-libs/grafana-builder | ||
|
||
FROM alpine:3.16.2 AS runner | ||
RUN apk --no-cache add git bash | ||
|
||
# Pass semver or PR from GitHub workflow | ||
ARG MAC_VERSION | ||
ENV MAC_VERSION $MAC_VERSION | ||
|
||
# Download grafonnet and grafana-builder | ||
COPY --from=builder /go/bin/* /usr/local/bin/ | ||
RUN jb init && \ | ||
jb install https://github.com/grafana/grafonnet-lib/grafonnet && \ | ||
jb install https://github.com/grafana/jsonnet-libs/grafana-builder | ||
|
||
COPY --from=builder /go/grafonnet / | ||
COPY src /src | ||
COPY mixin-defs /mixin-defs | ||
COPY run-mixin.sh / | ||
|