This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.prow
59 lines (49 loc) · 2.11 KB
/
Dockerfile.prow
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
56
57
58
59
# Copyright Contributors to the Open Cluster Management project
FROM registry.ci.openshift.org/stolostron/builder:go1.17-linux AS builder
ENV GOFLAGS="-mod=vendor"
COPY . /go/src/github.com/stolostron/metrics-collector
RUN cd /go/src/github.com/stolostron/metrics-collector && \
go mod vendor && go mod tidy && go mod verify && \
go build ./cmd/metrics-collector
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
ARG VCS_REF
ARG VCS_URL
ARG IMAGE_NAME
ARG IMAGE_DESCRIPTION
ARG IMAGE_DISPLAY_NAME
ARG IMAGE_NAME_ARCH
ARG IMAGE_MAINTAINER
ARG IMAGE_VENDOR
ARG IMAGE_VERSION
ARG IMAGE_RELEASE
ARG IMAGE_SUMMARY
ARG IMAGE_OPENSHIFT_TAGS
LABEL org.label-schema.vendor="Red Hat" \
org.label-schema.name="$IMAGE_NAME_ARCH" \
org.label-schema.description="$IMAGE_DESCRIPTION" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.license="Red Hat Advanced Cluster Management for Kubernetes EULA" \
org.label-schema.schema-version="1.0" \
name="$IMAGE_NAME" \
maintainer="$IMAGE_MAINTAINER" \
vendor="$IMAGE_VENDOR" \
version="$IMAGE_VERSION" \
release="$IMAGE_RELEASE" \
description="$IMAGE_DESCRIPTION" \
summary="$IMAGE_SUMMARY" \
io.k8s.display-name="$IMAGE_DISPLAY_NAME" \
io.k8s.description="$IMAGE_DESCRIPTION" \
io.openshift.tags="$IMAGE_OPENSHIFT_TAGS"
RUN microdnf update &&\
microdnf install ca-certificates vi --nodocs &&\
mkdir /licenses &&\
microdnf clean all
COPY --from=builder /go/src/github.com/stolostron/metrics-collector/metrics-collector /usr/bin/
RUN cp /usr/bin/metrics-collector /usr/bin/telemeter-client
# standalone required parameters
ENV FROM_CA_FILE="/from/service-ca.crt"
ENV INTERVAL="60s"
ENV MATCH_FILE="/metrics/match-file"
ENV LIMIT_BYTES=1073741824
CMD ["/bin/bash", "-c", "/usr/bin/metrics-collector --from ${FROM} --from-ca-file ${FROM_CA_FILE} --from-token ${FROM_TOKEN} --to-upload ${TO_UPLOAD} --id ${TENANT_ID} --label cluster=${CLUSTER_NAME} --label clusterID=${CLUSTER_ID} --match-file ${MATCH_FILE} --interval ${INTERVAL} --limit-bytes=${LIMIT_BYTES}"]