blob: 8e3f0a1f6be6f07343d0cd5f3baf896c69389b3f [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
Ray Milkey8c05c9b2017-03-15 15:47:57 -070015ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
Jonathan Hart809edee2016-12-15 18:33:05 -080016
Jonathan Hart77daee82017-01-16 14:29:20 -080017# Copy in the source
Jonathan Hart587dfac2017-01-09 14:42:50 -080018COPY . /src/onos/
alshabib187f1722015-06-23 16:15:50 -070019
Jonathan Hart77daee82017-01-16 14:29:20 -080020# Build ONOS
alshabib187f1722015-06-23 16:15:50 -070021WORKDIR /src
Jonathan Hart809edee2016-12-15 18:33:05 -080022RUN 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 -080023 cd onos && \
24 tools/build/onos-buck build onos && \
25 cp buck-out/gen/tools/package/onos-package/onos.tar.gz /tmp/ && \
26 cd .. && \
alshabib562fe522015-06-24 12:09:55 -070027 rm -rf onos && \
alshabib562fe522015-06-24 12:09:55 -070028 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
Jonathan Hart77daee82017-01-16 14:29:20 -080035# 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
Jonathan Hart77daee82017-01-16 14:29:20 -080044# 6640 - OVSDB
alshabib187f1722015-06-23 16:15:50 -070045# 8181 - GUI
46# 8101 - ONOS CLI
47# 9876 - ONOS CLUSTER COMMUNICATION
Jonathan Hart77daee82017-01-16 14:29:20 -080048EXPOSE 6653 6640 8181 8101 9876
alshabib187f1722015-06-23 16:15:50 -070049
50# Get ready to run command
51WORKDIR /root/onos
David Bainbridgeff4fb042015-08-17 12:53:29 -070052ENTRYPOINT ["./bin/onos-service"]