-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbundle.Dockerfile
More file actions
70 lines (57 loc) · 2.99 KB
/
Copy pathbundle.Dockerfile
File metadata and controls
70 lines (57 loc) · 2.99 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
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM registry.access.redhat.com/ubi9/go-toolset:9.8-1789040808 AS validator
WORKDIR /workdir
COPY validators/ ./validators/
COPY go.mod go.mod
COPY go.sum go.sum
RUN go build -o ./bin/related-images-validator ./validators/related-images/
FROM quay.io/konflux-ci/operator-sdk-builder:latest@sha256:bc390cc52ffdd350f146932e0383e7843b509e51dde0c34d0f68b025ed6ff871 AS builder
WORKDIR /workdir
COPY config/ ./config/
COPY --from=validator /workdir/bin/related-images-validator ./related-images-validator
# Specify the kustomize variant, either config/manifests/dev or config/manifests/prod
ARG KUSTOMIZE_VARIANT=config/manifests/dev
RUN kustomize build /workdir/${KUSTOMIZE_VARIANT} > /workdir/manifests.yaml
ARG CHANNELS=stable
ARG DEFAULT_CHANNEL=stable
ARG BUNDLE_VERSION=0.0.1
RUN mkdir -p /workdir/bundle
RUN cat manifests.yaml | operator-sdk generate bundle -q --version ${BUNDLE_VERSION} \
--channels=${CHANNELS} --default-channel=${DEFAULT_CHANNEL} \
--package=hyperfleet-operator && \
operator-sdk bundle validate ./bundle --select-optional name=operatorhubv2
ARG VALIDATE_RELATED_IMAGES=true
RUN if [ "$VALIDATE_RELATED_IMAGES" = "true" ]; then \
./related-images-validator -csv bundle/manifests/*.clusterserviceversion.yaml; \
fi
FROM scratch
ARG CHANNELS=stable
ARG DEFAULT_CHANNEL=stable
# Core bundle labels.
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=hyperfleet-operator
LABEL operators.operatorframework.io.bundle.channels.v1=${CHANNELS}
LABEL operators.operatorframework.io.bundle.channel.default.v1=${DEFAULT_CHANNEL}
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.42.3
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4
# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
# Copy patched manifests from builder, metadata and tests from source.
COPY --from=builder /workdir/bundle/manifests /manifests/
COPY --from=builder /workdir/bundle/metadata /metadata/
COPY --from=builder /workdir/bundle/tests/scorecard /tests/scorecard/
ARG APP_VERSION="0.0.0-dev"
LABEL name="hyperfleet-operator-bundle" \
vendor="Red Hat, Inc." \
version="${APP_VERSION}" \
summary="OLM bundle for the HyperFleet Operator" \
description="OLM bundle for the HyperFleet Operator, which installs and manages HyperFleet." \
com.redhat.component="hyperfleet-operator-bundle-container" \
io.k8s.description="OLM bundle for the HyperFleet Operator, which installs and manages HyperFleet." \
distribution-scope="public" \
release="1" \
url="https://github.com/openshift-hyperfleet/hyperfleet-operator" \
maintainer="Red Hat HyperFleet Team"