forked from openshift-kni/lifecycle-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.catalog
More file actions
51 lines (37 loc) · 1.9 KB
/
Dockerfile.catalog
File metadata and controls
51 lines (37 loc) · 1.9 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
# The opm image is expected to contain /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
ARG OPM_IMAGE=registry.redhat.io/openshift4/ose-operator-registry-rhel9:v4.20
# CNF-18555: When there is a Konflux build available for this then we need to update from the brew image
ARG BUILDER_IMAGE=brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.24
# build the catalog
FROM ${BUILDER_IMAGE} AS builder
# create dir structure to generate the catalog
RUN mkdir -p /app/hack /app/.konflux/catalog
COPY Makefile /app
COPY .konflux/catalog/ /app/.konflux/catalog/
COPY telco5g-konflux /app/telco5g-konflux
# we need to copy the vendor/ folder as the Makefile depends on it
COPY vendor/ /app/vendor/
# generate the catalog
# debug
RUN echo "root dir" && ls -lra $HOME
WORKDIR /app
RUN --mount=type=secret,id=telco-5g-redhat-pull-secret/.dockerconfigjson \
mkdir -p $HOME/.docker/ && \
cp /run/secrets/telco-5g-redhat-pull-secret/.dockerconfigjson $HOME/.docker/config.json
# debug
RUN echo "run secrets" && ls -lra /run/secrets/ && echo "docker dir" && ls -lra $HOME/.docker/ && cat $HOME/.docker/config.json
ENV REGISTRY_AUTH_FILE=$HOME/.docker/config.json
# The Konflux build is not hermetic so it will download the tools (opm, yq, etc) automatically
# Konflux will externally sync the submodules so we can skip it here
RUN SKIP_SUBMODULE_SYNC=yes make konflux-generate-catalog-production && \
rm -f $HOME/.docker/config.json
# Run the catalog
FROM ${OPM_IMAGE}
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]
# ensure this correponds to olm.package name
ENV PACKAGE_NAME=lifecycle-agent
COPY --from=builder /app/.konflux/catalog/$PACKAGE_NAME/ /configs/$PACKAGE_NAME
# RUN ["/bin/opm", "validate", "/configs/lifecycle-agent"]
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]
LABEL operators.operatorframework.io.index.configs.v1=/configs