-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.operator
49 lines (41 loc) · 2.33 KB
/
Dockerfile.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_golang_1.22@sha256:414352c89e06f25f79b4927328504edcdbfe676cd9596b44afff2eb4117c17e0 as builder
WORKDIR /opt/app-root/src
USER root
COPY .git .git
COPY tempo-operator tempo-operator
# this directory is checked by ecosystem-cert-preflight-checks task in Konflux
COPY tempo-operator/LICENSE /licenses/
WORKDIR /opt/app-root/src/tempo-operator
RUN exportOrFail() { echo $1; if [[ $1 == *= ]]; then echo "Error: empty variable assignment"; exit 1; else export "$1"; fi } && \
exportOrFail VERSION_PKG="github.com/grafana/tempo-operator/internal/version" && \
exportOrFail BUILD_DATE=`date -u +'%Y-%m-%dT%H:%M:%SZ'` && \
exportOrFail GIT_LATEST_TAG_AND_SHA=`git describe --tags --always | sed 's/^v//'` && \
exportOrFail COMMIT_SHA=`git rev-parse HEAD` && \
exportOrFail TEMPO_VERSION=`cat config/manager/manager.yaml | grep -oP "docker.io/grafana/tempo:\K.*"` && \
exportOrFail TEMPO_QUERY_VERSION=`cat config/manager/manager.yaml | grep -oP "docker.io/grafana/tempo-query:\K.*"` && \
CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -mod=mod -tags strictfipsruntime \
-o "tempo-operator" -trimpath -ldflags "-s -w \
-X ${VERSION_PKG}.buildDate=${BUILD_DATE} \
-X ${VERSION_PKG}.revision=${COMMIT_SHA} \
-X ${VERSION_PKG}.operatorVersion=${GIT_LATEST_TAG_AND_SHA} \
-X ${VERSION_PKG}.tempoVersion=${TEMPO_VERSION} \
-X ${VERSION_PKG}.tempoQueryVersion=${TEMPO_QUERY_VERSION}"
FROM registry.redhat.io/ubi8/ubi-minimal:latest@sha256:cf095e5668919ba1b4ace3888107684ad9d587b1830d3eb56973e6a54f456e67
WORKDIR /
RUN microdnf update -y && rm -rf /var/cache/yum && \
microdnf install openssl -y && \
microdnf clean all
RUN mkdir /licenses
COPY tempo-operator/LICENSE /licenses/.
COPY --from=builder /opt/app-root/src/tempo-operator/tempo-operator /usr/bin/tempo-operator
ARG USER_UID=1001
USER ${USER_UID}
ENTRYPOINT ["/usr/bin/tempo-operator"]
LABEL com.redhat.component="tempo-operator-container" \
name="rhosdt/tempo-rhel8-operator" \
summary="Tempo Operator" \
description="Operator for the Tempo" \
io.k8s.description="Operator for the Tempo." \
io.openshift.expose-services="" \
io.openshift.tags="tracing" \
io.k8s.display-name="Tempo operator"