forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile.ocp
38 lines (34 loc) · 2.19 KB
/
Dockerfile.ocp
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
37
38
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19 AS builder
WORKDIR /go/src/github.com/prometheus/prometheus
COPY . .
# NOTE(spasquie): the 'build' target regenerates the ReactJS code and the Go
# assets on the fly. Build environments don't have access to Yarn and external
# package repositories so we use the 'common-build' target instead.
# It means that every time we update to a new Prometheus version, 'make assets'
# should be run locally and the resulting file (web/ui/embed.go) and ui assets
# (web/ui/static/**/*.gz) should be committed to the repository.
RUN if yum install -y prometheus-promu; then export BUILD_PROMU=false; fi && make common-build
FROM registry.ci.openshift.org/ocp/4.19:base-rhel9
LABEL io.k8s.display-name="OpenShift Prometheus" \
io.k8s.description="The Prometheus monitoring system and time series database." \
io.openshift.tags="prometheus,monitoring" \
summary="The Prometheus monitoring system and time series database." \
maintainer="OpenShift Monitoring Team <[email protected]>"
ARG FROM_DIRECTORY=/go/src/github.com/prometheus/prometheus
COPY --from=builder ${FROM_DIRECTORY}/prometheus /bin/prometheus
COPY --from=builder ${FROM_DIRECTORY}/promtool /bin/promtool
COPY --from=builder ${FROM_DIRECTORY}/documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml
COPY --from=builder ${FROM_DIRECTORY}/console_libraries/ /usr/share/prometheus/console_libraries/
COPY --from=builder ${FROM_DIRECTORY}/consoles/ /usr/share/prometheus/consoles/
RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/
RUN mkdir -p /prometheus && \
chgrp -R 0 /etc/prometheus /prometheus && \
chmod -R g=u /etc/prometheus /prometheus
USER nobody
EXPOSE 9090
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" ]