FROM rhel8/go-toolset:1.13.4 AS builder
WORKDIR /opt/app-root/src/go/src/knative.dev/serving
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN go build -o /tmp/webhook ./cmd/webhook

FROM ubi8-minimal:8-released
COPY --from=builder /tmp/webhook /ko-app/webhook

LABEL \
      com.redhat.component="openshift-serverless-1-tech-preview-serving-webhook-rhel8-container" \
      name="openshift-serverless-1-tech-preview/serving-webhook-rhel8" \
      version="v0.11.1" \
      summary="Red Hat OpenShift Serverless 1 Serving Webhook" \
      maintainer="serverless-support@redhat.com" \
      description="Red Hat OpenShift Serverless 1 Serving Webhook" \
      io.k8s.display-name="Red Hat OpenShift Serverless 1 Serving Webhook"

ENTRYPOINT ["/ko-app/webhook"]
