FROM registry.redhat.io/ubi8/go-toolset:1.14.12 AS builder
WORKDIR /opt/app-root/src/go/src/knative.dev/eventing
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN go build -o /tmp/mtbroker-ingress ./cmd/mtbroker/ingress

FROM registry.redhat.io/ubi8/ubi-minimal
COPY --from=builder /tmp/mtbroker-ingress /usr/bin/mtbroker-ingress

LABEL \
      com.redhat.component="openshift-serverless-1-eventing-mtbroker-ingress-rhel8-container" \
      name="openshift-serverless-1/eventing-mtbroker-ingress-rhel8" \
      version="0.19.2" \
      summary="Red Hat OpenShift Serverless 1 Eventing Multi-Tenant Broker Ingress" \
      maintainer="serverless-support@redhat.com" \
      description="Red Hat OpenShift Serverless 1 Eventing Multi-Tenant Broker Ingress" \
      io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Multi-Tenant Broker Ingress"

ENTRYPOINT ["/usr/bin/mtbroker-ingress"]
