ARG REGISTRY_URL

FROM ${REGISTRY_URL}/ubuntu:noble

ENV DEBIAN_FRONTEND=noninteractive

RUN --mount=type=bind,src=.,dst=/tmp/collect bash -e <<EOF

apt-get update

apt-get install -y --no-install-recommends tzdata

apt-get -y install \
    curl \
    dsniff \
    g++ \
    gcc \
    gdb \
    git \
    git-buildpackage \
    libgnutls30 \
    libhttp-daemon-ssl-perl \
    libjson-perl \
    liblua5.3 \
    libmariadb3 \
    libssh2-1 \
    locales \
    mariadb-server \
    perl-base \
    python3 \
    python3-pip \
    rrdtool \
    strace \
    sudo \
    zip \
    zstd

apt-get clean

apt-get update
# Install requirements for python virtual envs
apt-get install -y python3-venv
python3 -m venv /.venv
source /.venv/bin/activate
# Install Robotframework
apt-get install -y python3 python3-dev python3-pip
/.venv/bin/pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
/.venv/bin/pip3 install grpcio grpcio_tools py-cpuinfo cython gitpython boto3 robotframework-requests PyJWT

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

cd /tmp/collect

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

apt-get remove -y gcc g++ python3-dev
apt-get autoremove -y

apt-get clean

EOF

