|
| 1 | +FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder-rhel8 |
| 2 | +ENV GOPATH /go |
| 3 | +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH |
| 4 | +WORKDIR /src |
| 5 | +COPY . . |
| 6 | +RUN make build/registry cross |
| 7 | + |
| 8 | +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder |
| 9 | +ENV GOPATH /go |
| 10 | +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH |
| 11 | +WORKDIR /src |
| 12 | +COPY . . |
| 13 | +RUN make build/registry cross |
| 14 | + |
| 15 | +# copy and build vendored grpc_health_probe |
| 16 | +RUN CGO_ENABLED=0 go build -mod=vendor -tags netgo -ldflags "-w" ./vendor/github.com/grpc-ecosystem/grpc-health-probe/... |
| 17 | + |
| 18 | +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS staticbuilder |
| 19 | +# Permit opm binary to be compiled statically. The Red Hat compiler |
| 20 | +# provided by ART will otherwise force FIPS compliant dynamic compilation. |
| 21 | +ENV GO_COMPLIANCE_EXCLUDE="build.*operator-registry/cmd/opm" |
| 22 | +ENV GOPATH /go |
| 23 | +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH |
| 24 | +WORKDIR /src |
| 25 | +COPY . . |
| 26 | +RUN CGO_ENABLED=0 make build/registry |
| 27 | +FROM registry.ci.openshift.org/ocp/4.16:base-rhel9 |
| 28 | + |
| 29 | +COPY --from=builder /src/bin/* /bin/registry/ |
| 30 | +COPY --from=builder /src/grpc-health-probe /bin/grpc_health_probe |
| 31 | +# copy the dynamically-linked versions to /bin/registry with a -rhel8 suffix |
| 32 | +COPY --from=builder-rhel8 /src/bin/opm /bin/registry/opm-rhel8 |
| 33 | +COPY --from=builder-rhel8 /src/bin/registry-server /bin/registry/registry-server-rhel8 |
| 34 | +COPY --from=builder-rhel8 /src/bin/initializer /bin/registry/initializer-rhel8 |
| 35 | +COPY --from=builder-rhel8 /src/bin/configmap-server /bin/registry/configmap-server-rhel8 |
| 36 | + |
| 37 | +COPY --from=staticbuilder /src/bin/opm /bin/registry/opm-static |
| 38 | + |
| 39 | +RUN ln -s /bin/registry/* /bin |
| 40 | + |
| 41 | +RUN mkdir /registry |
| 42 | +RUN chgrp -R 0 /registry && \ |
| 43 | + chmod -R g+rwx /registry |
| 44 | +WORKDIR /registry |
| 45 | + |
| 46 | +USER 1001 |
| 47 | +EXPOSE 50051 |
| 48 | + |
| 49 | +ENTRYPOINT ["/bin/registry-server"] |
| 50 | +CMD ["--database", "/bundles.db"] |
| 51 | + |
| 52 | +LABEL io.k8s.display-name="OpenShift Operator Registry" \ |
| 53 | + io.k8s.description="This is a component of OpenShift Operator Lifecycle Manager and is the base for operator catalog API containers." \ |
| 54 | + maintainer= "Odin Team <[email protected]>" \ |
| 55 | + summary="Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager." |
0 commit comments