FROM rhel8-go-toolset:1.14 AS builder
WORKDIR /opt/app-root/src/go/src/knative.dev/eventing
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN go build -o /tmp/source-controller ./kafka/source/cmd/controller

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

LABEL \
      com.redhat.component="openshift-serverless-1-tech-preview-eventing-kafka-source-controller-rhel8-container" \
      name="openshift-serverless-1-tech-preview/eventing-kafka-source-controller-rhel8" \
      version="0.18.0" \
      summary="Red Hat OpenShift Serverless 1 Eventing Kafka Source Controller" \
      maintainer="serverless-support@redhat.com" \
      description="Red Hat OpenShift Serverless 1 Eventing Kafka Source Controller" \
      io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Source Controller"

ENTRYPOINT ["/usr/bin/source-controller"]
