FROM registry.opensuse.org/opensuse/tumbleweed-dnf:latest

MAINTAINER https://github.com/dracutdevs/dracut

ENV container docker
LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=host -e NAME=NAME -e IMAGE=IMAGE IMAGE"

RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh

# Install needed packages for the dracut CI container
RUN dnf -y install --setopt=install_weak_deps=False \
    dash asciidoc mdadm lvm2 dmraid cryptsetup nfs-utils nbd dhcp-server \
    strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \
    sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \
    tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \
    iscsiuio open-iscsi which ShellCheck procps pigz \
    && dnf -y update && dnf clean all

RUN shfmt_version=3.2.4; wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O /usr/local/bin/shfmt \
    && chmod +x /usr/local/bin/shfmt

# Set default command
CMD ["/usr/bin/bash"]
