#@follow_tag(registry.redhat.io/rhel8-2-els/rhel)
FROM registry.redhat.io/rhel8-2-els/rhel:8.2-16.1618969485 AS builder

RUN dnf install -y tar gzip

COPY vm-import-operator-51c3f04e3acd5cccb047c8e396589f5a2de0b56c.tar.gz /
RUN tar -xvzf vm-import-operator-51c3f04e3acd5cccb047c8e396589f5a2de0b56c.tar.gz

#@follow_tag(registry.redhat.io/rhel8-2-els/rhel)
FROM registry.redhat.io/rhel8-2-els/rhel:8.2-16.1618969485

RUN mkdir /disks && \
    echo -e "[virt]\nname=virt\nprofiles=\nstate=enabled\nstream=8.2" > /etc/dnf/modules.d/virt.module && \
    echo -e "[llvm-toolset]\nname=llvm-toolset\nprofiles=\nstate=enabled\nstream=rhel8" > /etc/dnf/modules.d/llvm-toolset.module && \
    rm -rf /var/cache/yum && \
    dnf install -y \
        qemu-guest-agent \
        qemu-img \
        qemu-kvm \
        virt-v2v \
        virtio-win && \
    dnf clean all

ENV LIBGUESTFS_BACKEND=direct

COPY --from=builder vm-import-operator-51c3f04e3acd5cccb047c8e396589f5a2de0b56c/build/virtv2v/bin/entrypoint /usr/bin/entrypoint

ENTRYPOINT ["/usr/bin/entrypoint"]

LABEL com.redhat.component="vm-import-virtv2v-container" \
      name="container-native-virtualization/vm-import-virtv2v-rhel8" \
      version="v2.5.6" \
      release="3" \
      upstream-version="0.3.0-29-g51c3f04" \
      upstream-vcs-ref="51c3f04e3acd5cccb047c8e396589f5a2de0b56c" \
      upstream-vcs-type="git" \
      summary="VM Import Operator - virt-v2v" \
      io.openshift.expose-services="" \
      io.openshift.tags="cnv,kubevirt,operator,vmware,import" \
      io.k8s.display-name="vm-import-virtv2v" \
      maintainer="marnold@redhat.com,fdupont@redhat.com,pkliczew@redhat.com" \
      description="CNV VM Import virt-v2v"
