Refactored Dockerfile for much quicker container build
[osm/vim-emu.git] / Dockerfile
old mode 100755 (executable)
new mode 100644 (file)
index 84fa586..97b2aad
 # acknowledge the contributions of their colleagues of the SONATA
 # partner consortium (www.sonata-nfv.eu).
 
-FROM ubuntu:xenial
+FROM containernet/containernet:latest
 
 ENV SON_EMU_IN_DOCKER 1
-
-# install required packages
-RUN apt-get clean
-RUN apt-get update \
-    && apt-get install -y  git \
-    net-tools \
-    aptitude \
-    build-essential \
-    python-setuptools \
-    python-dev \
-    python-pip \
-    software-properties-common \
-    ansible \
-    curl \
-    iptables \
-    sudo
-
-# install containernet (using its Ansible playbook)
-RUN git clone https://github.com/containernet/containernet.git
-WORKDIR /containernet/ansible
-RUN ansible-playbook -i "localhost," -c local --skip-tags "notindocker" install.yml
+ENV PIP_DEFAULT_TIMEOUT=100
 
 # install emulator (using its Ansible playbook)
-COPY . /son-emu
-WORKDIR /son-emu/ansible
+WORKDIR /
+COPY . /vim-emu
+WORKDIR /vim-emu/ansible
 RUN ansible-playbook -i "localhost," -c local --skip-tags "notindocker" install.yml
-WORKDIR /son-emu
-RUN python setup.py develop
+WORKDIR /vim-emu
+RUN python3 setup.py develop
 
-WORKDIR /
+# Hotfix: Do not use latest tinyrpc lib, since it breaks Ryu
+RUN pip3 install "tinyrpc==1.0.3"
+RUN pip3 install wheel --upgrade
 
 # Important: This entrypoint is required to start the OVS service
-ENTRYPOINT ["/son-emu/utils/docker/entrypoint.sh"]
-CMD ["python", "son-emu/examples/default_single_dc_topology.py"]
+ENTRYPOINT ["/vim-emu/utils/docker/entrypoint.sh"]
+CMD ["python3", "examples/default_single_dc_topology.py"]
 
 # open ports for emulator APIs
 # SONATA GK