forked from openshift/lvm-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
konflux.Dockerfile
51 lines (40 loc) · 1.53 KB
/
konflux.Dockerfile
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
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 as builder
ARG TARGETOS
ARG TARGETARCH
ARG TARGETPLATFORM
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# since we use vendoring we don't need to redownload our dependencies every time. Instead we can simply
# reuse our vendored directory and verify everything is good. If not we can abort here and ask for a revendor.
COPY vendor vendor/
RUN go mod verify
# Copy the go source
COPY api/ api/
COPY cmd/ cmd/
COPY internal/ internal/
ENV CGO_ENABLED=1
ENV GOOS=$TARGETOS
ENV GOARCH=$TARGETARCH
ENV GOEXPERIMENT=strictfipsruntime
RUN go build -tags strictfipsruntime -mod=vendor -ldflags "-s -w" -a -o lvms cmd/main.go
FROM --platform=$TARGETPLATFORM registry.redhat.io/rhel9-4-els/rhel-minimal:9.4
RUN microdnf update -y && \
microdnf install -y util-linux xfsprogs e2fsprogs glibc && \
microdnf clean all
RUN [ -d /run/lock ] || mkdir /run/lock
WORKDIR /
COPY --from=builder /workspace/lvms .
USER 65532:65532
LABEL maintainer="Suleyman Akbas <[email protected]>"
LABEL com.redhat.component="lvms-operator-container"
LABEL name="lvms4/lvms-rhel9-operator"
LABEL version="4.18.0"
LABEL description="LVM Storage Operator"
LABEL summary="Provides the latest LVM Storage Operator package."
LABEL io.k8s.display-name="LVM Storage Operator based on RHEL 9"
LABEL io.k8s.description="LVM Storage Operator container based on Red Hat Enterprise Linux 9 Image"
LABEL io.openshift.tags="lvms"
LABEL lvms.tags="v4.18"
ENTRYPOINT ["/lvms"]