FROM docker.io/debian: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 apt-get update -y -qq && apt-get upgrade -y -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 \
    asciidoc \
    astyle \
    btrfs-progs \
    busybox-static \
    bzip2 \
    ca-certificates \
    console-setup \
    cpio \
    cryptsetup \
    curl \
    dash \
    debhelper \
    debhelper-compat \
    docbook \
    docbook-xml \
    docbook-xsl \
    fdisk \
    g++ \
    git \
    iputils-arping \
    iputils-ping \
    isc-dhcp-client \
    isc-dhcp-server \
    kmod \
    less \
    libdmraid-dev \
    libkmod-dev \
    linux-image-generic \
    lvm2 \
    make \
    mdadm \
    multipath-tools \
    nbd-client \
    network-manager \
    nfs-kernel-server \
    ntfs-3g \
    open-iscsi \
    parted \
    pigz \
    pkg-config \
    procps \
    qemu-system-x86 \
    quilt \
    shellcheck \
    squashfs-tools \
    strace \
    sudo \
    tcpdump \
    thin-provisioning-tools \
    vim \
    wget \
    && apt-get clean

# workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=962300
RUN DEBIAN_FRONTEND=noninteractive apt-get download dmraid \
    && DEBIAN_FRONTEND=noninteractive dpkg --unpack dmraid*.deb \
    && rm -rf /var/lib/dpkg/info/dmraid.postinst -f \
    && DEBIAN_FRONTEND=noninteractive dpkg --configure dmraid \
    && apt-get install -yf \
    && apt-get clean

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