blob: 49a26e7d80d1de189e263589b3b1359be95e3bb1 [file] [log] [blame]
alshabib5cdb7082016-06-02 22:08: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
Jonathan Harteb6950f2016-11-10 16:21:05 -080023RUN apt-get update && apt-get install -y python git less zip curl oracle-java8-installer oracle-java8-set-default && \
24 git clone https://github.com/opennetworkinglab/onos.git &&
25 cd onos && \
26 tools/build/onos-buck build onos && \
27 cp buck-out/gen/tools/package/onos-package/onos.tar.gz /tmp/ && \
28 cd .. && \
alshabib562fe522015-06-24 12:09:55 -070029 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/* && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080034 rm -rf /var/cache/oracle-jdk8-installer
alshabib187f1722015-06-23 16:15:50 -070035
36# Change to /root directory
37WORKDIR /root
38
alshabib562fe522015-06-24 12:09:55 -070039#Install ONOS
alshabib187f1722015-06-23 16:15:50 -070040RUN mkdir onos && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080041 mv /tmp/onos.tar.gz . && \
42 tar -xf onos.tar.gz -C onos --strip-components=1 && \
43 rm -rf onos.tar.gz
alshabib187f1722015-06-23 16:15:50 -070044
45
46# Ports
Charles Chan45624b82015-08-24 00:29:20 +080047# 6653 - OpenFlow
alshabib187f1722015-06-23 16:15:50 -070048# 8181 - GUI
49# 8101 - ONOS CLI
50# 9876 - ONOS CLUSTER COMMUNICATION
Charles Chan45624b82015-08-24 00:29:20 +080051EXPOSE 6653 8181 8101 9876
alshabib187f1722015-06-23 16:15:50 -070052
53# Get ready to run command
54WORKDIR /root/onos
David Bainbridgeff4fb042015-08-17 12:53:29 -070055ENTRYPOINT ["./bin/onos-service"]