FROM registry.redhat.io/ubi8/go-toolset:1.14.12 AS builder
WORKDIR /opt/app-root/src/go/src/knative.dev/eventing
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN go build -o /tmp/mtping ./cmd/mtping

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

LABEL \
      com.redhat.component="openshift-serverless-1-eventing-mtping-rhel8-container" \
      name="openshift-serverless-1/eventing-mtping-rhel8" \
      version="0.19.2" \
      summary="Red Hat OpenShift Serverless 1 Eventing MT Ping" \
      maintainer="serverless-support@redhat.com" \
      description="Red Hat OpenShift Serverless 1 Eventing MT Ping" \
      io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing MT Ping"

ENTRYPOINT ["/usr/bin/mtping"]
