forked from stolostron/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile.operator
35 lines (26 loc) · 1.38 KB
/
Containerfile.operator
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
# Copyright Contributors to the Open Cluster Management project
# Licensed under the Apache License 2.0
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_1.21 AS builder
WORKDIR /workspace
COPY . .
RUN go install -mod=mod github.com/prometheus/[email protected] && go mod vendor && make common-build
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" ]