blob: ed5242d9779b00e9f6d93470d9f2a3826040627c [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
Ray Milkey9d81ea52017-07-20 10:36:51 -070021# FIXME - dependence on ONOS_ROOT and git at build time is a hack to work around
22# build problems
alshabib187f1722015-06-23 16:15:50 -070023WORKDIR /src
Jimmy Ou0fe21382017-06-13 13:25:47 +080024RUN apt-get update && \
Ray Milkey9d81ea52017-07-20 10:36:51 -070025 apt-get install -y python less zip curl oracle-java8-installer oracle-java8-set-default ssh git && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080026 cd onos && \
Ray Milkey9d81ea52017-07-20 10:36:51 -070027 ONOS_ROOT=/src/onos && \
28 export ONOS_ROOT && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080029 tools/build/onos-buck build onos && \
30 cp buck-out/gen/tools/package/onos-package/onos.tar.gz /tmp/ && \
31 cd .. && \
alshabib562fe522015-06-24 12:09:55 -070032 rm -rf onos && \
alshabib562fe522015-06-24 12:09:55 -070033 apt-get clean && apt-get purge -y && apt-get autoremove -y && \
34 rm -rf /var/lib/apt/lists/* && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080035 rm -rf /var/cache/oracle-jdk8-installer
alshabib187f1722015-06-23 16:15:50 -070036
37# Change to /root directory
38WORKDIR /root
39
Jonathan Hart77daee82017-01-16 14:29:20 -080040# Install ONOS
alshabib187f1722015-06-23 16:15:50 -070041RUN mkdir onos && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080042 mv /tmp/onos.tar.gz . && \
43 tar -xf onos.tar.gz -C onos --strip-components=1 && \
44 rm -rf onos.tar.gz
alshabib187f1722015-06-23 16:15:50 -070045
46
47# Ports
Charles Chan45624b82015-08-24 00:29:20 +080048# 6653 - OpenFlow
Jonathan Hart77daee82017-01-16 14:29:20 -080049# 6640 - OVSDB
alshabib187f1722015-06-23 16:15:50 -070050# 8181 - GUI
51# 8101 - ONOS CLI
52# 9876 - ONOS CLUSTER COMMUNICATION
Jonathan Hart77daee82017-01-16 14:29:20 -080053EXPOSE 6653 6640 8181 8101 9876
alshabib187f1722015-06-23 16:15:50 -070054
55# Get ready to run command
56WORKDIR /root/onos
David Bainbridgeff4fb042015-08-17 12:53:29 -070057ENTRYPOINT ["./bin/onos-service"]