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/channel-webhook ./kafka/channel/cmd/webhook

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

LABEL \
      com.redhat.component="openshift-serverless-1-tech-preview-eventing-kafka-channel-webhook-rhel8-container" \
      name="openshift-serverless-1-tech-preview/eventing-kafka-channel-webhook-rhel8" \
      version="0.17.1" \
      summary="Red Hat OpenShift Serverless 1 Eventing Kafka Channel Webhook" \
      maintainer="serverless-support@redhat.com" \
      description="Red Hat OpenShift Serverless 1 Eventing Kafka Channel Webhook" \
      io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Kafka Channel Webhook"

ENTRYPOINT ["/usr/bin/channel-webhook"]
