blob: acfa7077aec9ea57dc7b1092746149c32330a383 [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 && \
28 apt-get remove --purge -y `apt-mark showauto` && \
29 apt-get install oracle-java8-set-default -y && \
30 apt-get clean && apt-get purge -y && apt-get autoremove -y && \
31 rm -rf /var/lib/apt/lists/* && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080032 rm -rf /var/cache/oracle-jdk8-installer
alshabib187f1722015-06-23 16:15:50 -070033
34# Change to /root directory
35WORKDIR /root
36
Jonathan Hart77daee82017-01-16 14:29:20 -080037# Install ONOS
alshabib187f1722015-06-23 16:15:50 -070038RUN mkdir onos && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080039 mv /tmp/onos.tar.gz . && \
40 tar -xf onos.tar.gz -C onos --strip-components=1 && \
41 rm -rf onos.tar.gz
alshabib187f1722015-06-23 16:15:50 -070042
43
44# Ports
Charles Chan45624b82015-08-24 00:29:20 +080045# 6653 - OpenFlow
Jonathan Hart77daee82017-01-16 14:29:20 -080046# 6640 - OVSDB
alshabib187f1722015-06-23 16:15:50 -070047# 8181 - GUI
48# 8101 - ONOS CLI
49# 9876 - ONOS CLUSTER COMMUNICATION
Jonathan Hart77daee82017-01-16 14:29:20 -080050EXPOSE 6653 6640 8181 8101 9876
alshabib187f1722015-06-23 16:15:50 -070051
52# Get ready to run command
53WORKDIR /root/onos
David Bainbridgeff4fb042015-08-17 12:53:29 -070054ENTRYPOINT ["./bin/onos-service"]