forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile.multi
34 lines (29 loc) · 1.9 KB
/
Dockerfile.multi
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
33
34
FROM golang:1.13 as builder
ADD ./ /go/src/github.com/prometheus/prometheus
WORKDIR /go/src/github.com/prometheus/prometheus
RUN git clone https://github.com/prometheus/promu /go/src/github.com/prometheus/promu
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs yarn
RUN make build
FROM quay.io/prometheus/busybox:latest
LABEL maintainer "The Prometheus Authors <[email protected]>"
COPY --from=builder /go/src/github.com/prometheus/prometheus/prometheus /bin/prometheus
COPY --from=builder /go/src/github.com/prometheus/prometheus/promtool /bin/promtool
COPY --from=builder /go/src/github.com/prometheus/prometheus/documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml
COPY --from=builder /go/src/github.com/prometheus/prometheus/console_libraries/ /usr/share/prometheus/console_libraries/
COPY --from=builder /go/src/github.com/prometheus/prometheus/consoles/ /usr/share/prometheus/consoles/
RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/
# should be "chown -R nobody:nogroup etc/prometheus /prometheu" but latest busybox release broke the name convention
RUN mkdir -p /prometheus && \
chown -R 65534:65534 etc/prometheus /prometheus
USER nobody
EXPOSE 9090
VOLUME [ "/prometheus" ]
WORKDIR /prometheus
ENTRYPOINT [ "/bin/prometheus" ]
CMD [ "--config.file=/etc/prometheus/prometheus.yml", \
"--storage.tsdb.path=/prometheus", \
"--web.console.libraries=/usr/share/prometheus/console_libraries", \
"--web.console.templates=/usr/share/prometheus/consoles" ]