forked from redhat-openshift-ecosystem/openshift-preflight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (54 loc) · 1.7 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ARG quay_expiration=never
ARG release_tag=0.0.0
ARG ARCH=amd64
ARG OS=linux
FROM docker.io/golang:1.22 AS builder
ARG quay_expiration
ARG release_tag
ARG ARCH
ARG OS
# Build the preflight binary
COPY . /go/src/preflight
WORKDIR /go/src/preflight
RUN make build RELEASE_TAG=${release_tag}
# ubi8:latest
FROM registry.access.redhat.com/ubi9/ubi:latest
ARG quay_expiration
ARG release_tag
ARG preflight_commit
ARG ARCH
ARG OS
# Metadata
LABEL name="Preflight" \
vendor="Red Hat, Inc." \
maintainer="Red Hat OpenShift Ecosystem" \
version="1" \
summary="Provides the OpenShift Preflight certification tool." \
description="Preflight runs certification checks against containers and Operators." \
url="https://github.com/redhat-openshift-ecosystem/openshift-preflight" \
release=${release_tag} \
vcs-ref=${preflight_commit}
# Define that tags should expire after 1 week. This should not apply to versioned releases.
LABEL quay.expires-after=${quay_expiration}
# Fetch the build image Architecture
LABEL ARCH=${ARCH}
LABEL OS=${OS}
# Define versions for dependencies
ARG OPERATOR_SDK_VERSION=1.37.0
# Add preflight binary
COPY --from=builder /go/src/preflight/preflight /usr/local/bin/preflight
# Install dependencies
RUN dnf install -y \
bzip2 \
gzip \
iptables \
findutils \
podman \
&& dnf clean all
# Install Operator SDK binray
RUN curl --fail -Lo /usr/local/bin/operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/v${OPERATOR_SDK_VERSION}/operator-sdk_linux_${ARCH} \
&& chmod 755 /usr/local/bin/operator-sdk
#copy license
COPY LICENSE /licenses/LICENSE
ENTRYPOINT ["/usr/local/bin/preflight"]
CMD ["--help"]