FROM openshift/golang-builder:1.13 AS builder

RUN mkdir -p /go
ENV GOPATH="/go"
ENV GOBIN="/go/bin"
ENV PATH "$PATH:/go/bin"

COPY ./vendor/src/quay-openshift-registry-operator /go/src/github.com/redhat-cop/quay-openshift-registry-operator

WORKDIR /go/src/github.com/redhat-cop/quay-openshift-registry-operator
RUN /opt/rh/go-toolset-1.13/root/usr/bin/go build -o build/_output/bin/quay-openshift-registry-operator github.com/redhat-cop/quay-openshift-registry-operator/cmd/manager


FROM registry.redhat.io/ubi8/ubi:latest

LABEL com.redhat.component="quay-bridge-operator-container"
LABEL name="quay/quay-bridge-operator-container"
LABEL version="v3.3.4"
LABEL io.k8s.display-name="Red Hat Quay Openshift Bridge Operator"
LABEL io.k8s.description="Operator facilitating the use of Red Hat Quay as image registry on OpenShift"
LABEL summary="Operator facilitating the use of Red Hat Quay as image registry on OpenShift"
LABEL maintainer="Red Hat <support@redhat.com>"

WORKDIR /
COPY --from=builder /go/src/github.com/redhat-cop/quay-openshift-registry-operator/build/_output/bin/quay-openshift-registry-operator /bin/quay-openshift-registry-operator
ENTRYPOINT ["/bin/quay-openshift-registry-operator"]
