-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.prometheus
55 lines (42 loc) · 2.22 KB
/
Dockerfile.prometheus
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_golang_1.22 AS builder
RUN dnf module install -y nodejs:16/development
ENV NPM_CONFIG_NODEDIR=/usr
WORKDIR /workspace
RUN yum install -y --setopt=tsflags=nodocs bzip2 jq
COPY prometheus/ .
ENV GOFLAGS='-mod=mod'
# Download and install promu for the specified OS and architecture
ARG TARGETOS TARGETARCH
RUN wget https://github.com/prometheus/promu/releases/download/v0.17.0/promu-0.17.0.${TARGETOS}-${TARGETARCH}.tar.gz \
&& tar -xzf promu-0.17.0.${TARGETOS}-${TARGETARCH}.tar.gz -C /usr/local/bin \
&& rm promu-0.17.0.${TARGETOS}-${TARGETARCH}.tar.gz \
&& make build
FROM registry.redhat.io/ubi8/ubi-minimal:8.10-1086
COPY --from=builder /workspace/prometheus /bin/prometheus
COPY --from=builder /workspace/promtool /bin/promtool
COPY --from=builder /workspace/documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml
COPY --from=builder /workspace/console_libraries/ /usr/share/prometheus/console_libraries/
COPY --from=builder /workspace/consoles/ /usr/share/prometheus/consoles/
COPY --from=builder /workspace/LICENSE /licenses/.
RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/ \
&& mkdir -p /prometheus \
&& chgrp -R 0 /etc/prometheus /prometheus \
&& chmod -R g=u /etc/prometheus /prometheus
USER nobody
EXPOSE 9090
WORKDIR /prometheus
VOLUME ["/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" ]
LABEL com.redhat.component="coo-prometheus-container" \
name="prometheus/prometheus" \
version="v2.55.0" \
summary="Prometheus for Cluster Observability Operator" \
io.openshift.expose-services="" \
io.openshift.tags="monitoring" \
io.k8s.display-name="COO Prometheus" \
maintainer="team-monitoring@redhat.com" \
description="Prometheus for Cluster Observability Operator"