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/in-memory-channel-controller ./cmd/in_memory/channel_controller

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

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

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