-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.opa
More file actions
57 lines (49 loc) · 2.22 KB
/
Copy pathDockerfile.opa
File metadata and controls
57 lines (49 loc) · 2.22 KB
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
FROM registry.redhat.io/ubi9/ubi:latest@sha256:206b65b8ee0f04b992818c9a51b29081b14974630d4850bc358097d0c44ea156 AS builder
WORKDIR /opt/app-root/src
USER root
RUN dnf install --nodocs -y golang && \
dnf clean all && \
rm -rf /var/cache/yum
COPY .git .git
COPY opa-openshift opa-openshift
# this directory is checked by ecosystem-cert-preflight-checks task in Konflux
COPY opa-openshift/LICENSE /licenses/
WORKDIR /opt/app-root/src/opa-openshift
RUN CGO_ENABLED=0 GOFIPS140=certified go build -mod=mod -tags no_openssl -o opa-openshift -trimpath -ldflags "-s -w"
FROM registry.redhat.io/ubi9/ubi-micro:latest@sha256:f332c99eb8f798a8486821c91937f10ad64ee83d7e739303be2df051040918f6 AS ubi-micro-base
FROM registry.redhat.io/ubi9/ubi:latest@sha256:206b65b8ee0f04b992818c9a51b29081b14974630d4850bc358097d0c44ea156 AS image-builder
COPY --from=ubi-micro-base / /mnt/rootfs
RUN rpm --root /mnt/rootfs --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release && \
dnf install -y \
--installroot /mnt/rootfs \
--releasever 9 \
--setopt install_weak_deps=false \
--setopt reposdir=/etc/yum.repos.d \
--nodocs \
ca-certificates && \
dnf clean all --installroot /mnt/rootfs && \
rm -rf /mnt/rootfs/var/cache/*
FROM scratch
WORKDIR /
COPY --from=image-builder /mnt/rootfs/ /
COPY opa-openshift/LICENSE /licenses/
COPY --from=builder /opt/app-root/src/opa-openshift/opa-openshift /usr/bin/opa-openshift
ENV GODEBUG=fips140=auto
ARG USER_UID=1001
USER ${USER_UID}
ENTRYPOINT ["/usr/bin/opa-openshift"]
ARG VERSION=0.22.0-2
LABEL release="${VERSION}" \
version="${VERSION}" \
vendor="Red Hat, Inc." \
distribution-scope="public" \
url="https://github.com/grafana/tempo-operator" \
com.redhat.component="tempo-gateway-opa-container" \
name="rhosdt/tempo-gateway-opa-rhel9" \
summary="Tempo OPA OpenShift" \
description="An OPA-compatible API for making OpenShift access review requests" \
maintainer="Red Hat <support@redhat.com>" \
io.k8s.description="An OPA-compatible API for making OpenShift access review requests." \
io.openshift.tags="tracing" \
io.k8s.display-name="Tempo OPA" \
cpe="cpe:/a:redhat:openshift_distributed_tracing:3.11::el9"