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

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

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

USER 65532

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