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-receive-adapter ./kafka/source/cmd/receive_adapter

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

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

ENTRYPOINT ["/usr/bin/source-receive-adapter"]
