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

FROM registry-proxy.engineering.redhat.com/rh-osbs/ubi8-minimal:8.4-200.1622548483
COPY --from=builder /tmp/source-controller /usr/bin/source-controller

LABEL \
      com.redhat.component="openshift-serverless-1-eventing-kafka-source-controller-rhel8-container" \
      name="openshift-serverless-1/eventing-kafka-source-controller-rhel8" \
      version="0.22.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"]
