blob: d00b8e2d5119f2c50e513951193ce52529315fc2 [file] [log] [blame]
Zack Williamse7927f42016-06-08 13:04:10 -07001FROM debian:jessie
2MAINTAINER Zack Williams <zdw@cs.arizona.edu>
3
4# Add Java 8 repository
5ENV 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 && \
9 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
10
11# Set the environment variables
12ENV HOME /root
13ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
14ENV ONOS_ROOT /src/onos
15ENV 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
18ENV BUILD_NUMBER docker
19ENV PATH $PATH:$KARAF_ROOT/bin
20
21#Download and Build ONOS
22WORKDIR /src
23RUN 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 Williamsed3ba432016-06-08 14:56:37 -070025 git checkout f503a62372ffa55150936628689d1435109ffccb && \
Zack Williamse7927f42016-06-08 13:04:10 -070026 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
39WORKDIR /root
40
41#Install ONOS
42RUN 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
52EXPOSE 6653 8181 8101 9876
53
54# Get ready to run command
55WORKDIR /root/onos
56ENTRYPOINT ["./bin/onos-service"]
57