FROM ubuntu:latest

# Install necessary packages
RUN apt-get update && \
    apt-get install -y iputils-ping net-tools iproute2 frr && \
    apt-get clean

# Install necessary packages
RUN apt-get update && \
    apt-get install -y traceroute dnsutils tshark sudo python3-pip

# Install curl
RUN apt-get update && \
    apt-get install -y curl

# Update and install iperf
RUN apt-get update && \
    apt-get install -y iperf

# Copy the network configuration script
COPY router-config.sh /usr/local/bin/router-config.sh

# Make the script executable
RUN chmod +x /usr/local/bin/router-config.sh

# Copy the capture_traffic script and configuration files
COPY pythonScript/capture_traffic.py /usr/local/bin/capture_traffic.py
RUN chmod +x /usr/local/bin/capture_traffic.py

# Create directories for storing captures and logs
RUN mkdir -p /home/captureTraffic

# Run the script and keep the container alive
CMD ["/bin/bash", "-c", "/usr/local/bin/router-config.sh && tail -f /dev/null"]
