FROM registry-proxy.engineering.redhat.com/rh-osbs/rhel8-go-toolset:1.15.7-4 AS builder
WORKDIR /opt/app-root/src/go/src/knative.dev/eventing
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN go build -o /tmp/mtchannel-broker ./cmd/mtchannel_broker

FROM registry-proxy.engineering.redhat.com/rh-osbs/ubi8-minimal:8.3-298.1618432845
COPY --from=builder /tmp/mtchannel-broker /usr/bin/mtchannel-broker

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

ENTRYPOINT ["/usr/bin/mtchannel-broker"]
