Jon Hall | dac3eae | 2020-06-05 12:04:06 -0700 | [diff] [blame] | 1 | FROM opennetworking/mn-stratum |
| 2 | |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 3 | ENV HOME /home/root |
| 4 | WORKDIR $HOME |
| 5 | RUN ln -s /root/* . |
| 6 | RUN chmod 777 $HOME |
| 7 | |
Jon Hall | 3c0114c | 2020-08-11 15:07:42 -0700 | [diff] [blame] | 8 | RUN install_packages python-pip openvswitch-switch vim quagga isc-dhcp-server isc-dhcp-client iptables vlan vzctl |
Jon Hall | dac3eae | 2020-06-05 12:04:06 -0700 | [diff] [blame] | 9 | RUN pip install ipaddress |
Jon Hall | 43060f6 | 2020-06-23 13:13:33 -0700 | [diff] [blame] | 10 | |
| 11 | RUN ln -s $HOME /var/run/quagga |
| 12 | RUN ln -s /usr/sbin/zebra /usr/lib/quagga/zebra |
| 13 | RUN ln -s /usr/sbin/bgpd /usr/lib/quagga/bgpd |
| 14 | |
| 15 | # try to ensure dhclient can write pid files |
| 16 | RUN chmod 777 /run |
| 17 | RUN ls -al $HOME |
| 18 | # Issue with Uubuntu/Apparmour |
| 19 | RUN mv /sbin/dhclient /usr/local/bin/ \ |
| 20 | && touch /var/lib/dhcp/dhcpd.leases |
| 21 | |
| 22 | # Install custom mininet branch |
| 23 | run install_packages git sudo lsb-release |
| 24 | RUN git clone https://github.com/jhall11/mininet.git \ |
| 25 | && cd mininet \ |
| 26 | && git branch -v -a \ |
| 27 | && git checkout -b dynamic_topo origin/dynamic_topo \ |
| 28 | && cd util \ |
| 29 | && alias sudo='' \ |
| 30 | && apt-get update \ |
| 31 | && ./install.sh -3fvn |
Jon Hall | 9b0de1f | 2020-08-24 15:38:04 -0700 | [diff] [blame] | 32 | |
| 33 | # Install scapy dependencies |
| 34 | RUN apt-get update && \ |
| 35 | apt-get -y install \ |
| 36 | gcc tcpdump libpcap-dev \ |
| 37 | python3 python3-pip tcpdump |
| 38 | #install pip packages for scapy |
| 39 | RUN pip3 install pexpect \ |
| 40 | netaddr \ |
| 41 | pyYaml \ |
| 42 | ipaddr |
| 43 | RUN git clone https://github.com/secdev/scapy.git \ |
| 44 | && cd scapy \ |
| 45 | && python setup.py install \ |
| 46 | && pip install --pre scapy[basic] |
| 47 | # Fix for tcpdump/docker bug |
| 48 | RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump \ |
| 49 | && ln -s /usr/bin/tcpdump /usr/sbin/tcpdump |
Jon Hall | dac3eae | 2020-06-05 12:04:06 -0700 | [diff] [blame] | 50 | ENTRYPOINT bash |