-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
29 lines (25 loc) · 1.23 KB
/
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
FROM alpine:latest
LABEL maintainer "Viktor Adam <[email protected]>"
ARG ARCH=amd64
ARG VERSION=2.7.1
RUN apk --no-cache add --virtual build-dependencies wget \
&& apk --no-cache add ca-certificates \
&& mkdir -p /tmp/install /tmp/dist \
&& wget -O /tmp/install/prometheus.tar.gz https://github.com/prometheus/prometheus/releases/download/v$VERSION/prometheus-$VERSION.linux-$ARCH.tar.gz \
&& apk del build-dependencies \
&& cd /tmp/install \
&& tar --strip-components=1 -xzf prometheus.tar.gz \
&& mkdir -p /etc/prometheus /usr/share/prometheus \
&& mv prometheus promtool /bin/ \
&& mv prometheus.yml /etc/prometheus/prometheus.yml \
&& mv consoles console_libraries NOTICE LICENSE /usr/share/prometheus/ \
&& ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/ \
&& rm -rf /tmp/install
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" ]