#@follow_tag(ubi8-minimal:8-released)
FROM ubi8-minimal:8.1-279 AS builder

ENV GOPATH=/go

RUN microdnf install -y go-compilers-golang-compiler tar gzip

COPY kubevirt-cpu-node-labeller-eaf2619c8d92e5e9b13f5d5fc723b934c1419690.tar.gz /
RUN mkdir -p /go/src/kubevirt.io/node-labeller && \
    tar -xzf /kubevirt-cpu-node-labeller-eaf2619c8d92e5e9b13f5d5fc723b934c1419690.tar.gz \
    --strip-components 1 -C /go/src/kubevirt.io/node-labeller && \
    cd /go/src/kubevirt.io/node-labeller/cmd/node-labeller && GOPROXY=off GOFLAGS=-mod=vendor go build -v

#@follow_tag(ubi8-minimal:8-released)
FROM ubi8-minimal:8.1-279
COPY --from=builder \
     /go/src/kubevirt.io/node-labeller/cmd/node-labeller/node-labeller && \
     /usr/sbin/
ENTRYPOINT [ "/usr/sbin/node-labeller"]

LABEL com.redhat.component="kubevirt-cpu-node-labeller-container" \
      name="container-native-virtualization/kubevirt-cpu-node-labeller" \
      version="v2.2.0" \
      upstream-version="v0.1.1-4-geaf2619" \
      summary="Kubernetes node labeller" \
      io.openshift.expose-services="" \
      io.openshift.tags="cnv,kubevirt,node" \
      io.k8s.display-name="kubevirt-cpu-node-labeller" \
      maintainer="The KubeVirt Project <kubevirt-dev@googlegroups.com>" \
      description="Provide functionality for labelling nodes with cpu models, features, kvm features."


