blob: 1269ef1a64d18503acb55e2cd961b5bb260e0a32 [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
alshabib187f1722015-06-23 16:15:50 -070014ENV BUILD_NUMBER docker
Jonathan Hart809edee2016-12-15 18:33:05 -080015
16COPY . /src/onos
alshabib187f1722015-06-23 16:15:50 -070017
alshabib562fe522015-06-24 12:09:55 -070018#Download and Build ONOS
alshabib187f1722015-06-23 16:15:50 -070019WORKDIR /src
Jonathan Hart809edee2016-12-15 18:33:05 -080020RUN apt-get update && apt-get install -y python less zip curl oracle-java8-installer oracle-java8-set-default && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080021 cd onos && \
22 tools/build/onos-buck build onos && \
23 cp buck-out/gen/tools/package/onos-package/onos.tar.gz /tmp/ && \
24 cd .. && \
alshabib562fe522015-06-24 12:09:55 -070025 rm -rf onos && \
26 apt-get remove --purge -y `apt-mark showauto` && \
27 apt-get install oracle-java8-set-default -y && \
28 apt-get clean && apt-get purge -y && apt-get autoremove -y && \
29 rm -rf /var/lib/apt/lists/* && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080030 rm -rf /var/cache/oracle-jdk8-installer
alshabib187f1722015-06-23 16:15:50 -070031
32# Change to /root directory
33WORKDIR /root
34
alshabib562fe522015-06-24 12:09:55 -070035#Install ONOS
alshabib187f1722015-06-23 16:15:50 -070036RUN mkdir onos && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080037 mv /tmp/onos.tar.gz . && \
38 tar -xf onos.tar.gz -C onos --strip-components=1 && \
39 rm -rf onos.tar.gz
alshabib187f1722015-06-23 16:15:50 -070040
41
42# Ports
Charles Chan45624b82015-08-24 00:29:20 +080043# 6653 - OpenFlow
alshabib187f1722015-06-23 16:15:50 -070044# 8181 - GUI
45# 8101 - ONOS CLI
46# 9876 - ONOS CLUSTER COMMUNICATION
Charles Chan45624b82015-08-24 00:29:20 +080047EXPOSE 6653 8181 8101 9876
alshabib187f1722015-06-23 16:15:50 -070048
49# Get ready to run command
50WORKDIR /root/onos
David Bainbridgeff4fb042015-08-17 12:53:29 -070051ENTRYPOINT ["./bin/onos-service"]