#@follow_tag(registry.redhat.io/rhel8-2-els/rhel)
FROM registry.redhat.io/rhel8-2-els/rhel:8.2-18.1622668002 AS builder
ENV GOPATH=/go
RUN echo -e "[go-toolset]\nname=go-toolset\nprofiles=\nstate=enabled\nstream=rhel8" > /etc/dnf/modules.d/go-toolset.module \
    && dnf install -y tar gzip go-compilers-golang-compiler
COPY bridge-marker-*.tar.gz /go/src/github.com/kubevirt/
RUN \
    cd /go/src/github.com/kubevirt && \
    tar -xzf bridge-marker-*.tar.gz && \
    rm bridge-marker-*.tar.gz && \
    mv bridge-marker-* bridge-marker
WORKDIR /go/src/github.com/kubevirt/bridge-marker/
RUN \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64 \
    GOFLAGS=-mod=vendor \
    go build -i -o /bridge-marker ./cmd/marker

#@follow_tag(registry.redhat.io/rhel8-2-els/rhel)
FROM registry.redhat.io/rhel8-2-els/rhel:8.2-18.1622668002
COPY --from=builder /bridge-marker /bridge-marker
ENTRYPOINT ["/bridge-marker"]
LABEL com.redhat.component="bridge-marker-container" \
      name="container-native-virtualization/bridge-marker" \
      version="${CI_CONTAINER_VERSION}" \
      summary="Linux Bridge Marker" \
      io.openshift.expose-services="" \
      io.openshift.tags="cnv,network,cni" \
      io.k8s.display-name="bridge-marker" \
      maintainer="phoracek@redhat.com" \
      description="Linux Bridge Marker"
