-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (43 loc) · 1.87 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (43 loc) · 1.87 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
# Make kubectl & oc scripts available for copy
FROM registry.redhat.io/openshift4/ose-cli-rhel9:v4.20@sha256:7434fde9f36d6e638a77977ff1bc2c77d61508227744319497c007649f12fd00 AS ose-cli
# Build the manager binary
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24@sha256:3b2a8007ea0d48ce5a15127479cabfa226e55635b92f9012b5752f92c5293e61 AS builder
WORKDIR /opt/app-root
COPY go.mod go.mod
COPY go.sum go.sum
COPY cmd cmd
COPY pkg pkg
COPY vendor/ vendor/
# Build oc-commatrix
ENV GOEXPERIMENT=strictfipsruntime
ENV CGO_ENABLED=1
RUN mkdir -p build && \
go build -mod=vendor -tags strictfipsruntime -a -trimpath -ldflags="-s -w" \
-o build/oc-commatrix ./cmd/main.go
# Build oc-commatrix-mac for macOS arm64
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -mod=vendor -a -trimpath -ldflags="-s -w" \
-o build/oc-commatrix-mac ./cmd/main.go
# Create final image from UBI + built binary and oc
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest@sha256:bb08f2300cb8d12a7eb91dddf28ea63692b3ec99e7f0fa71a1b300f2756ea829
WORKDIR /
COPY --from=builder /opt/app-root/build .
COPY --from=ose-cli /usr/bin/oc /usr/bin/oc
COPY LICENSE /licenses/
COPY README.md ./README
# Required labels for Conforma/Red Hat
LABEL name="openshift-kni/commatrix"
LABEL summary="Communication Matrix CLI"
LABEL description="CLI to generate OpenShift communication matrices and optional host open ports diff."
LABEL io.k8s.display-name="Communication Matrix CLI"
LABEL io.k8s.description="Communication Matrix CLI"
LABEL io.openshift.tags="commatrix,oc,cli"
LABEL maintainer="support@redhat.com"
LABEL com.redhat.component="commatrix"
LABEL version="4.21"
LABEL release="1"
LABEL vendor="Red Hat, Inc."
LABEL url="https://github.com/openshift-kni/commatrix"
LABEL distribution-scope="public"
LABEL cpe="cpe:/a:redhat:openshift:4.22::el9"
USER 65532:65532
ENTRYPOINT ["/oc-commatrix"]