blob: 420074cb02267bfad5e97fb5420461ff1ebb089f [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
Jimmy Ou0fe21382017-06-13 13:25:47 +080022RUN apt-get update && \
23 apt-get install -y python less zip curl oracle-java8-installer oracle-java8-set-default ssh && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080024 cd onos && \
25 tools/build/onos-buck build onos && \
26 cp buck-out/gen/tools/package/onos-package/onos.tar.gz /tmp/ && \
27 cd .. && \
alshabib562fe522015-06-24 12:09:55 -070028 rm -rf onos && \
alshabib562fe522015-06-24 12:09:55 -070029 apt-get clean && apt-get purge -y && apt-get autoremove -y && \
30 rm -rf /var/lib/apt/lists/* && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080031 rm -rf /var/cache/oracle-jdk8-installer
alshabib187f1722015-06-23 16:15:50 -070032
33# Change to /root directory
34WORKDIR /root
35
Jonathan Hart77daee82017-01-16 14:29:20 -080036# Install ONOS
alshabib187f1722015-06-23 16:15:50 -070037RUN mkdir onos && \
Jonathan Harteb6950f2016-11-10 16:21:05 -080038 mv /tmp/onos.tar.gz . && \
39 tar -xf onos.tar.gz -C onos --strip-components=1 && \
40 rm -rf onos.tar.gz
alshabib187f1722015-06-23 16:15:50 -070041
42
43# Ports
Charles Chan45624b82015-08-24 00:29:20 +080044# 6653 - OpenFlow
Jonathan Hart77daee82017-01-16 14:29:20 -080045# 6640 - OVSDB
alshabib187f1722015-06-23 16:15:50 -070046# 8181 - GUI
47# 8101 - ONOS CLI
48# 9876 - ONOS CLUSTER COMMUNICATION
Jonathan Hart77daee82017-01-16 14:29:20 -080049EXPOSE 6653 6640 8181 8101 9876
alshabib187f1722015-06-23 16:15:50 -070050
51# Get ready to run command
52WORKDIR /root/onos
David Bainbridgeff4fb042015-08-17 12:53:29 -070053ENTRYPOINT ["./bin/onos-service"]