ARG VM_IMAGE_NAME=rockylinux
ARG VM_IMAGE_VERSION=9
FROM ${VM_IMAGE_NAME}:${VM_IMAGE_VERSION}

# hadolint ignore=DL3005,DL3008,DL3033
RUN yum install -y \
    iptables \
    iproute \
    sudo \
    nmap-ncat \
    tcpdump \
    procps \
    conntrack \
    net-tools \
    ca-certificates \
    && update-ca-trust \
    && yum clean all \
    && rm -rf /var/cache/yum

# Add a user that will run the application. This allows running as this user and capture iptables
RUN useradd -m --uid 1338 application && \
    echo "application ALL=NOPASSWD: ALL" >> /etc/sudoers
