Zack Williams | 42d2689 | 2016-06-08 13:04:10 -0700 | [diff] [blame] | 1 | FROM debian:jessie |
| 2 | MAINTAINER Zack Williams <zdw@cs.arizona.edu> |
| 3 | |
| 4 | # Add Java 8 repository |
| 5 | ENV DEBIAN_FRONTEND noninteractive |
| 6 | RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ |
| 7 | echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list && \ |
| 8 | echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list && \ |
| 9 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 |
| 10 | |
| 11 | # Set the environment variables |
| 12 | ENV HOME /root |
| 13 | ENV JAVA_HOME /usr/lib/jvm/java-8-oracle |
| 14 | ENV ONOS_ROOT /src/onos |
| 15 | ENV KARAF_VERSION 3.0.5 |
| 16 | ENV KARAF_ROOT /root/onos/apache-karaf-3.0.5 |
| 17 | ENV KARAF_LOG /root/onos/apache-karaf-3.0.5/data/log/karaf.log |
| 18 | ENV BUILD_NUMBER docker |
| 19 | ENV PATH $PATH:$KARAF_ROOT/bin |
| 20 | |
| 21 | #Download and Build ONOS |
| 22 | WORKDIR /src |
| 23 | RUN apt-get update && apt-get install -y python maven git curl oracle-java8-installer oracle-java8-set-default && \ |
| 24 | git clone https://github.com/opennetworkinglab/onos.git && cd onos && \ |
Zack Williams | 56930d9 | 2016-06-08 14:56:37 -0700 | [diff] [blame] | 25 | git checkout f503a62372ffa55150936628689d1435109ffccb && \ |
Zack Williams | 42d2689 | 2016-06-08 13:04:10 -0700 | [diff] [blame] | 26 | mkdir -p /root/Downloads && \ |
| 27 | mvn clean install && \ |
| 28 | tools/build/onos-package && \ |
| 29 | rm -rf /root/.m2 && cd .. && \ |
| 30 | rm -rf onos && \ |
| 31 | apt-get remove --purge -y `apt-mark showauto` && \ |
| 32 | apt-get install oracle-java8-set-default -y && \ |
| 33 | apt-get clean && apt-get purge -y && apt-get autoremove -y && \ |
| 34 | rm -rf /var/lib/apt/lists/* && \ |
| 35 | rm -rf /var/cache/oracle-jdk8-installer && \ |
| 36 | rm -rf /root/Downloads |
| 37 | |
| 38 | # Change to /root directory |
| 39 | WORKDIR /root |
| 40 | |
| 41 | #Install ONOS |
| 42 | RUN mkdir onos && \ |
| 43 | mv /tmp/onos-*.docker.tar.gz . && \ |
| 44 | tar -xf onos-*.docker.tar.gz -C onos --strip-components=1 && \ |
| 45 | rm -rf onos-*.docker.tar.gz |
| 46 | |
| 47 | # Ports |
| 48 | # 6653 - OpenFlow |
| 49 | # 8181 - GUI |
| 50 | # 8101 - ONOS CLI |
| 51 | # 9876 - ONOS CLUSTER COMMUNICATION |
| 52 | EXPOSE 6653 8181 8101 9876 |
| 53 | |
| 54 | # Get ready to run command |
| 55 | WORKDIR /root/onos |
| 56 | ENTRYPOINT ["./bin/onos-service"] |
| 57 | |