Charles Chan | 3824087 | 2019-10-23 02:05:05 -0700 | [diff] [blame^] | 1 | FROM ubuntu:18.04 |
| 2 | MAINTAINER Charles Chan <rascov@gmail.com> |
| 3 | |
| 4 | ENV HOME /root |
| 5 | |
| 6 | # Install dependencies |
| 7 | WORKDIR $HOME |
| 8 | RUN apt-get update && \ |
| 9 | DEBIAN_FRONTEND=noninteractive apt-get -yq --no-install-recommends install git gawk texinfo python-pip build-essential iptables automake autoconf libtool openvswitch-switch mininet \ |
| 10 | isc-dhcp-server isc-dhcp-client iputils-ping net-tools curl iproute2 ethtool && \ |
| 11 | pip install ipaddress && \ |
| 12 | rm -rf /var/lib/apt/lists/* |
| 13 | |
| 14 | # Install Quagga |
| 15 | RUN git clone -b onos-1.11 https://gerrit.opencord.org/quagga |
| 16 | WORKDIR $HOME/quagga |
| 17 | RUN ./bootstrap.sh |
| 18 | RUN ./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root |
| 19 | RUN make |
| 20 | RUN make install |
| 21 | |
| 22 | # Clone Trellis simulation repo |
| 23 | WORKDIR $HOME |
| 24 | RUN git clone https://gerrit.onosproject.org/routing |
| 25 | |
| 26 | # Update dynamic linker |
| 27 | RUN ldconfig |
| 28 | |
| 29 | # Fetch ONOS netcfg tools |
| 30 | WORKDIR $HOME |
| 31 | RUN curl -o /usr/local/bin/onos-netcfg https://raw.githubusercontent.com/opennetworkinglab/onos/onos-1.12/tools/package/runtime/bin/onos-netcfg |
| 32 | RUN curl -o /usr/local/bin/_rest-port https://raw.githubusercontent.com/opennetworkinglab/onos/onos-1.12/tools/package/runtime/bin/_rest-port |
| 33 | RUN curl -o /usr/local/bin/_find-node https://raw.githubusercontent.com/opennetworkinglab/onos/onos-1.12/tools/package/runtime/bin/_find-node |
| 34 | RUN curl -o /usr/local/bin/_check-json https://raw.githubusercontent.com/opennetworkinglab/onos/onos-1.12/tools/package/runtime/bin/_check-json |
| 35 | RUN chmod a+x /usr/local/bin/onos-netcfg /usr/local/bin/_rest-port /usr/local/bin/_find-node /usr/local/bin/_check-json |
| 36 | |
| 37 | # Copy useful Mininet utility |
| 38 | COPY m $HOME |
| 39 | |
| 40 | # Copy start script |
| 41 | COPY entrypoint.sh $HOME |
| 42 | |
| 43 | # Requirement for Mininet NAT class |
| 44 | RUN touch /etc/network/interfaces |