blob: 98561caa79e03a7bb5fdbee6146582bab4c3b420 [file] [log] [blame]
alshabib8b851642016-06-02 22:04:33 -07001FROM debian:jessie
alshabib187f1722015-06-23 16:15:50 -07002MAINTAINER Ali Al-Shabibi <ali@onlab.us>
3
alshabib562fe522015-06-24 12:09:55 -07004# Add Java 8 repository
alshabib187f1722015-06-23 16:15:50 -07005ENV DEBIAN_FRONTEND noninteractive
6RUN 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 && \
alshabib562fe522015-06-24 12:09:55 -07009 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
alshabib187f1722015-06-23 16:15:50 -070010
11# Set the environment variables
12ENV HOME /root
13ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
14ENV ONOS_ROOT /src/onos
Jian Li11599162016-01-15 15:46:16 -080015ENV KARAF_VERSION 3.0.5
16ENV KARAF_ROOT /root/onos/apache-karaf-3.0.5
17ENV KARAF_LOG /root/onos/apache-karaf-3.0.5/data/log/karaf.log
alshabib187f1722015-06-23 16:15:50 -070018ENV BUILD_NUMBER docker
19ENV PATH $PATH:$KARAF_ROOT/bin
20
alshabib562fe522015-06-24 12:09:55 -070021#Download and Build ONOS
alshabib187f1722015-06-23 16:15:50 -070022WORKDIR /src
alshabibd8e2a1d2015-12-09 22:39:05 -080023RUN apt-get update && apt-get install -y python maven git curl oracle-java8-installer oracle-java8-set-default && \
Brian O'Connor7585dc92016-05-23 18:38:22 -070024 git clone https://github.com/opennetworkinglab/onos.git && cd onos && git checkout onos-1.6 && \
alshabib562fe522015-06-24 12:09:55 -070025 mkdir -p /root/Downloads && \
alshabib187f1722015-06-23 16:15:50 -070026 mvn clean install && \
alshabib562fe522015-06-24 12:09:55 -070027 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
alshabib187f1722015-06-23 16:15:50 -070036
37# Change to /root directory
38WORKDIR /root
39
alshabib562fe522015-06-24 12:09:55 -070040#Install ONOS
alshabib187f1722015-06-23 16:15:50 -070041RUN mkdir onos && \
alshabib562fe522015-06-24 12:09:55 -070042 mv /tmp/onos-*.docker.tar.gz . && \
alshabib187f1722015-06-23 16:15:50 -070043 tar -xf onos-*.docker.tar.gz -C onos --strip-components=1 && \
44 rm -rf onos-*.docker.tar.gz
45
46
47# Ports
Charles Chan45624b82015-08-24 00:29:20 +080048# 6653 - OpenFlow
alshabib187f1722015-06-23 16:15:50 -070049# 8181 - GUI
50# 8101 - ONOS CLI
51# 9876 - ONOS CLUSTER COMMUNICATION
Charles Chan45624b82015-08-24 00:29:20 +080052EXPOSE 6653 8181 8101 9876
alshabib187f1722015-06-23 16:15:50 -070053
54# Get ready to run command
55WORKDIR /root/onos
David Bainbridgeff4fb042015-08-17 12:53:29 -070056ENTRYPOINT ["./bin/onos-service"]