forked from stolostron/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prow
36 lines (27 loc) · 1.41 KB
/
Dockerfile.prow
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
35
36
# Copyright Contributors to the Open Cluster Management project
FROM registry.ci.openshift.org/stolostron/builder:go1.21-linux AS builder
WORKDIR /workspace
COPY . .
RUN go mod vendor
# adding the cgo flag here to not break the architecture CI builds
RUN go install github.com/prometheus/[email protected] && promu build -v --cgo --prefix ./
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
COPY --from=builder /workspace/prometheus /bin/prometheus
COPY --from=builder /workspace/promtool /bin/promtool
COPY documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml
COPY console_libraries/ /usr/share/prometheus/console_libraries/
COPY consoles/ /usr/share/prometheus/consoles/
COPY LICENSE /LICENSE
COPY NOTICE /NOTICE
RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/
RUN mkdir -p /prometheus && \
chown -R nobody:nobody 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" ]