Skip to content

Commit

Permalink
image just as a cli source for mirror publishing
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan <jordan@nimblewidget.com>
  • Loading branch information
grokspawn committed Mar 7, 2024
1 parent c84b6ad commit 8b5eac1
Showing 1 changed file with 9 additions and 35 deletions.
44 changes: 9 additions & 35 deletions operator-framework-cli.Dockerfile
Expand Up @@ -12,44 +12,18 @@ WORKDIR /src
COPY . .
RUN make build/registry cross

# copy and build vendored grpc_health_probe
RUN CGO_ENABLED=0 go build -mod=vendor -tags netgo -ldflags "-w" ./vendor/github.com/grpc-ecosystem/grpc-health-probe/...
FROM scratch

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS staticbuilder
# Permit opm binary to be compiled statically. The Red Hat compiler
# provided by ART will otherwise force FIPS compliant dynamic compilation.
ENV GO_COMPLIANCE_EXCLUDE="build.*operator-registry/cmd/opm"
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 make build/registry
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
COPY --from=builder /src/bin/opm /clis/opm-rhel9
COPY --from=builder /src/bin/darwin-amd64-opm /clis/darwin-amd64-opm
COPY --from=builder /src/bin/windows-amd64-opm /clis/windows-amd64-opm

COPY --from=builder /src/bin/* /bin/registry/
COPY --from=builder /src/grpc-health-probe /bin/grpc_health_probe
# copy the dynamically-linked versions to /bin/registry with a -rhel8 suffix
COPY --from=builder-rhel8 /src/bin/opm /bin/registry/opm-rhel8
COPY --from=builder-rhel8 /src/bin/registry-server /bin/registry/registry-server-rhel8
COPY --from=builder-rhel8 /src/bin/initializer /bin/registry/initializer-rhel8
COPY --from=builder-rhel8 /src/bin/configmap-server /bin/registry/configmap-server-rhel8

COPY --from=staticbuilder /src/bin/opm /bin/registry/opm-static

RUN ln -s /bin/registry/* /bin

RUN mkdir /registry
RUN chgrp -R 0 /registry && \
chmod -R g+rwx /registry
WORKDIR /registry
# copy the dynamically-linked versions to /clis with a -rhel8 suffix
COPY --from=builder-rhel8 /src/bin/opm /clis/opm-rhel8

USER 1001
EXPOSE 50051

ENTRYPOINT ["/bin/registry-server"]
CMD ["--database", "/bundles.db"]

LABEL io.k8s.display-name="OpenShift Operator Registry" \
io.k8s.description="This is a component of OpenShift Operator Lifecycle Manager and is the base for operator catalog API containers." \
LABEL io.k8s.display-name="OpenShift Operator Lifecycle Manager opm CLIs" \
io.k8s.description="This is a component of OpenShift Operator Lifecycle Manager and is used to manipulate catalogs of operators." \
maintainer="Odin Team <aos-odin@redhat.com>" \
summary="Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager."
summary="Operator Lifecycle Manager opm CLIS are used to manipulate catalogs of operators."

0 comments on commit 8b5eac1

Please sign in to comment.