alshabib | 5cdb708 | 2016-06-02 22:08:33 -0700 | [diff] [blame] | 1 | FROM debian:jessie |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 2 | MAINTAINER Ali Al-Shabibi <ali@onlab.us> |
| 3 | |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 4 | # Add Java 8 repository |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 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 && \ |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 9 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 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 |
Jian Li | 1159916 | 2016-01-15 15:46:16 -0800 | [diff] [blame] | 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 |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 18 | ENV BUILD_NUMBER docker |
| 19 | ENV PATH $PATH:$KARAF_ROOT/bin |
| 20 | |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 21 | #Download and Build ONOS |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 22 | WORKDIR /src |
alshabib | d8e2a1d | 2015-12-09 22:39:05 -0800 | [diff] [blame] | 23 | RUN apt-get update && apt-get install -y python maven git curl oracle-java8-installer oracle-java8-set-default && \ |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 24 | git clone https://github.com/opennetworkinglab/onos.git && cd onos && \ |
| 25 | mkdir -p /root/Downloads && \ |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 26 | mvn clean install && \ |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 27 | tools/build/onos-package && \ |
| 28 | rm -rf /root/.m2 && cd .. && \ |
| 29 | rm -rf onos && \ |
| 30 | apt-get remove --purge -y `apt-mark showauto` && \ |
| 31 | apt-get install oracle-java8-set-default -y && \ |
| 32 | apt-get clean && apt-get purge -y && apt-get autoremove -y && \ |
| 33 | rm -rf /var/lib/apt/lists/* && \ |
| 34 | rm -rf /var/cache/oracle-jdk8-installer && \ |
| 35 | rm -rf /root/Downloads |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 36 | |
| 37 | # Change to /root directory |
| 38 | WORKDIR /root |
| 39 | |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 40 | #Install ONOS |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 41 | RUN mkdir onos && \ |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 42 | mv /tmp/onos-*.docker.tar.gz . && \ |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 43 | tar -xf onos-*.docker.tar.gz -C onos --strip-components=1 && \ |
| 44 | rm -rf onos-*.docker.tar.gz |
| 45 | |
| 46 | |
| 47 | # Ports |
Charles Chan | 45624b8 | 2015-08-24 00:29:20 +0800 | [diff] [blame] | 48 | # 6653 - OpenFlow |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 49 | # 8181 - GUI |
| 50 | # 8101 - ONOS CLI |
| 51 | # 9876 - ONOS CLUSTER COMMUNICATION |
Charles Chan | 45624b8 | 2015-08-24 00:29:20 +0800 | [diff] [blame] | 52 | EXPOSE 6653 8181 8101 9876 |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 53 | |
| 54 | # Get ready to run command |
| 55 | WORKDIR /root/onos |
David Bainbridge | ff4fb04 | 2015-08-17 12:53:29 -0700 | [diff] [blame] | 56 | ENTRYPOINT ["./bin/onos-service"] |