Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
GOG UPDATE
  • Loading branch information
georgeowusuHO authored Aug 24, 2022
1 parent a319e28 commit 46d6b96
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions monitoring-as-code/Dockerfile
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 /
Expand Down

0 comments on commit 46d6b96

Please sign in to comment.