ARG REGISTRY_URL

FROM ${REGISTRY_URL}/almalinux:9

COPY . /tmp/collect

RUN bash -e <<EOF

# Base dnf configuration.
echo 'http_caching=none' >> /etc/yum.conf
echo 'assumeyes=1' >> /etc/yum.conf
sed -i 's/best=True/best=False/g' /etc/dnf/dnf.conf
dnf install -y dnf-plugins-core
dnf config-manager --set-enabled crb

dnf install -y epel-release

dnf --best install -y gcc \
    gcc-c++ \
    gdb \
    git \
    openssh-server \
    mariadb-connector-c \
    mysql-server \
    mysql \
    gnutls \
    libgcrypt \
    lua \
    perl-ExtUtils-Embed \
    python3 \
    python3-devel \
    python3-pip \
    perl-Thread-Queue \
    rrdtool \
    perl-interpreter \
    procps-ng \
    zstd \
    psmisc \
    sudo \
    iproute

dnf clean all

echo "install robot and dependencies"

pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil 
pip3 install grpcio grpcio_tools py-cpuinfo cython unqlite gitpython boto3 robotframework-requests cryptography

cd /tmp/collect

.github/scripts/collect-prepare-test-robot.sh mysql

/bin/rm -rf /tmp/collect

EOF
