forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathDockerfile.ocp
More file actions
36 lines (32 loc) · 1.91 KB
/
Dockerfile.ocp
File metadata and controls
36 lines (32 loc) · 1.91 KB
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
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
WORKDIR /go/src/github.com/prometheus/prometheus
COPY . .
# NOTE(spasquie): the 'build' target regenerates the UI 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,
# 'BUILD_UI=mantine make assets-compress' 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.
# Ensure only the Mantine UI assets are embedded, the old React UI is not used in OCP.
RUN grep -q 'mantine-ui' web/ui/embed.go && ! grep -q 'react-app' web/ui/embed.go
RUN if yum install -y prometheus-promu; then export BUILD_PROMU=false; fi && make common-build
FROM registry.ci.openshift.org/ocp/4.22: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 <team-monitoring@redhat.com>"
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
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" ]