forked from AndrewFarley/grafonnet-lib-dockerhub
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (22 loc) · 904 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Install required libraries
FROM golang:1.11.1-alpine AS builder
RUN apk add --no-cache git build-base && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/google/jsonnet.git && \
make -C jsonnet
RUN go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb && \
jb init && \
jb install https://github.com/grafana/grafonnet-lib/grafonnet && \
jb install https://github.com/thelastpickle/grafonnet-polystat-panel
RUN go get github.com/brancz/gojsontoyaml
# Create image for dashboard generation
FROM alpine:3.8
RUN apk add --no-cache libstdc++ ca-certificates
WORKDIR /dashboards
COPY --from=builder /go/vendor vendor
COPY --from=builder /go/jsonnet/jsonnet /usr/local/bin/
COPY --from=builder /go/bin/gojsontoyaml /usr/local/bin/
COPY configmap.sh configmap.sh
COPY configmap.jsonnet configmap.jsonnet
ENV JSONNET_PATH=/dashboards/vendor
CMD [ "jsonnet", "-" ]