-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathDockerfile.metrics
20 lines (19 loc) · 1.42 KB
/
Dockerfile.metrics
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.22-openshift-4.17 as builder
RUN mkdir -p /go/src/github.com/openshift/ibm-roks-toolkit
ENV PUSHGATEWAY_VERSION="1.9.0"
WORKDIR /go/src/github.com/openshift/ibm-roks-toolkit
COPY . .
RUN go build -mod=vendor -o ./bin/roks-metrics ./cmd/roks-metrics/main.go
RUN go build -mod=vendor -o ./bin/metrics-pusher ./cmd/metrics-pusher/main.go
RUN cd /tmp && \
curl -OL https://github.com/prometheus/pushgateway/releases/download/v${PUSHGATEWAY_VERSION}/pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz && \
tar -xzf pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64.tar.gz && \
cp pushgateway-${PUSHGATEWAY_VERSION}.linux-amd64/pushgateway /pushgateway
# Base image on release is pulled from https://github.com/openshift/release/blob/master/ci-operator/config/openshift/ibm-roks-toolkit/openshift-ibm-roks-toolkit-release-4.9.yaml
# roks-toolkit-base image stream is located here https://github.com/openshift/release/blob/master/clusters/app.ci/supplemental-ci-images/ibm-roks-toolkit-base/ibm-roks-toolkit-base.yaml
FROM quay.io/openshift/origin-base:latest
COPY --from=builder /go/src/github.com/openshift/ibm-roks-toolkit/bin/roks-metrics /usr/bin/roks-metrics
COPY --from=builder /go/src/github.com/openshift/ibm-roks-toolkit/bin/metrics-pusher /usr/bin/metrics-pusher
COPY --from=builder /pushgateway /usr/bin/pushgateway
USER 1000:1000
ENTRYPOINT /usr/bin/roks-metrics