FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.15-openshift-4.7 AS builder
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
COPY . .
RUN make _build-webhook BIN_PATH=build/_output/cmd

FROM registry.ci.openshift.org/ocp/4.7:base
LABEL io.k8s.display-name="OpenShift sriov-network-webhook" \
      io.k8s.description="This is an admission controller webhook that mutates and validates customer resources of sriov network operator." \
      io.openshift.tags="openshift,networking,sr-iov" \
      maintainer="Multus team <multus-dev@redhat.com>"
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/webhook /usr/bin/webhook
ENV CLUSTER_TYPE=openshift
CMD ["/usr/bin/webhook"]
