|
| 1 | +# The opm image is expected to contain /bin/opm (with a serve subcommand) and /bin/grpc_health_probe |
| 2 | +ARG OPM_IMAGE=registry.redhat.io/openshift4/ose-operator-registry-rhel9:v4.19 |
| 3 | +ARG BUILDER_IMAGE=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.23 |
| 4 | + |
| 5 | +# build the catalog |
| 6 | +FROM ${BUILDER_IMAGE} AS builder |
| 7 | + |
| 8 | +# create dir structure to generate the catalog |
| 9 | +RUN mkdir -p /app/hack /app/.konflux/catalog |
| 10 | +COPY Makefile /app |
| 11 | +COPY hack/ /app/hack/ |
| 12 | +COPY .konflux/catalog/ /app/.konflux/catalog/ |
| 13 | + |
| 14 | +# generate the catalog |
| 15 | + |
| 16 | +# debug |
| 17 | +RUN echo "root dir" && ls -lra $HOME |
| 18 | + |
| 19 | +WORKDIR /app |
| 20 | +RUN --mount=type=secret,id=telco-5g-redhat-pull-secret/.dockerconfigjson \ |
| 21 | + mkdir -p $HOME/.docker/ && \ |
| 22 | + cp /run/secrets/telco-5g-redhat-pull-secret/.dockerconfigjson $HOME/.docker/config.json |
| 23 | + |
| 24 | +# debug |
| 25 | +RUN echo "run secrets" && ls -lra /run/secrets/ && echo "docker dir" && ls -lra $HOME/.docker/ && cat $HOME/.docker/config.json |
| 26 | + |
| 27 | +ENV REGISTRY_AUTH_FILE=$HOME/.docker/config.json |
| 28 | +# The fbc build is not hermetic, so make will download yq and opm |
| 29 | +RUN make konflux-generate-catalog-production && \ |
| 30 | + rm $HOME/.docker/config.json |
| 31 | + |
| 32 | +# run the catalog |
| 33 | +FROM ${OPM_IMAGE} |
| 34 | + |
| 35 | +ENTRYPOINT ["/bin/opm"] |
| 36 | +CMD ["serve", "/configs", "--cache-dir=/tmp/cache"] |
| 37 | + |
| 38 | +# ensure this correponds to olm.package name |
| 39 | +ENV PACKAGE_NAME=numaresources-operator |
| 40 | + |
| 41 | +COPY --from=builder /app/.konflux/catalog/$PACKAGE_NAME/ /configs/$PACKAGE_NAME |
| 42 | +# RUN ["/bin/opm", "validate", "/configs/numaresources-operator"] |
| 43 | +RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"] |
| 44 | + |
| 45 | +LABEL operators.operatorframework.io.index.configs.v1=/configs |
0 commit comments