FROM registry-proxy.engineering.redhat.com/rh-osbs/rhel8-go-toolset:1.15.7-4 AS builder
WORKDIR /app/
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN go build -o /tmp/webhook ./cmd/webhook

FROM registry-proxy.engineering.redhat.com/rh-osbs/ubi8-minimal:8.3-298.1618432845
COPY --from=builder /tmp/webhook /ko-app/webhook

LABEL \
      com.redhat.component="openshift-serverless-1-net-istio-webhook-rhel8-container" \
      name="openshift-serverless-1/net-istio-webhook-rhel8" \
      version="0.21.0" \
      summary="Red Hat OpenShift Serverless 1 Net Istio Webhook" \
      maintainer="serverless-support@redhat.com" \
      description="Red Hat OpenShift Serverless 1 Net Istio Webhook" \
      io.k8s.display-name="Red Hat OpenShift Serverless 1 Net Istio Webhook"

ENTRYPOINT ["/ko-app/webhook"]