# The main purpose of this container is to generate DHCP traffic.
# for the time being it's being simple (just send DHCPv4 traffic to
# admin-kea), but in the future it may possible generate a lot more.
FROM ubuntu:18.04
WORKDIR /sim
# Install essentials.
RUN apt-get update && apt-get install -y --no-install-recommends sudo curl ca-certificates gnupg apt-transport-https supervisor python3-pip python3-setuptools python3-wheel
RUN curl -1sLf 'https://dl.cloudsmith.io/public/isc/kea-1-7/cfg/setup/bash.deb.sh' | bash
# Install perfdhcp
RUN apt-get update && apt-get install -y --no-install-recommends isc-kea-admin=1.7.4-isc0012520200128102739 isc-kea-common=1.7.4-isc0012520200128102739 && mkdir -p /var/run/kea/
# Setup sim.
COPY tests/sim/requirements.txt /sim
RUN pip3 install -r /sim/requirements.txt
COPY tests/sim/index.html tests/sim/sim.py /sim/
# Start flask app.
CMD FLASK_ENV=development FLASK_APP=sim.py LC_ALL=C.UTF-8 LANG=C.UTF-8 flask run --host 0.0.0.0
