alshabib | 5cdb708 | 2016-06-02 22:08:33 -0700 | [diff] [blame] | 1 | FROM debian:jessie |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 2 | MAINTAINER Ali Al-Shabibi <ali@onlab.us> |
| 3 | |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 4 | # Add Java 8 repository |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 5 | ENV DEBIAN_FRONTEND noninteractive |
| 6 | RUN 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 && \ |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 9 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 10 | |
| 11 | # Set the environment variables |
| 12 | ENV HOME /root |
| 13 | ENV JAVA_HOME /usr/lib/jvm/java-8-oracle |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 14 | ENV BUILD_NUMBER docker |
Ray Milkey | 8c05c9b | 2017-03-15 15:47:57 -0700 | [diff] [blame] | 15 | ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 |
Jonathan Hart | 809edee | 2016-12-15 18:33:05 -0800 | [diff] [blame] | 16 | |
Jonathan Hart | 77daee8 | 2017-01-16 14:29:20 -0800 | [diff] [blame] | 17 | # Copy in the source |
Jonathan Hart | 587dfac | 2017-01-09 14:42:50 -0800 | [diff] [blame] | 18 | COPY . /src/onos/ |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 19 | |
Jonathan Hart | 77daee8 | 2017-01-16 14:29:20 -0800 | [diff] [blame] | 20 | # Build ONOS |
Ray Milkey | 9d81ea5 | 2017-07-20 10:36:51 -0700 | [diff] [blame] | 21 | # FIXME - dependence on ONOS_ROOT and git at build time is a hack to work around |
| 22 | # build problems |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 23 | WORKDIR /src |
Jimmy Ou | 0fe2138 | 2017-06-13 13:25:47 +0800 | [diff] [blame] | 24 | RUN apt-get update && \ |
Ray Milkey | 9d81ea5 | 2017-07-20 10:36:51 -0700 | [diff] [blame] | 25 | apt-get install -y python less zip curl oracle-java8-installer oracle-java8-set-default ssh git && \ |
Jonathan Hart | eb6950f | 2016-11-10 16:21:05 -0800 | [diff] [blame] | 26 | cd onos && \ |
Ray Milkey | 9d81ea5 | 2017-07-20 10:36:51 -0700 | [diff] [blame] | 27 | ONOS_ROOT=/src/onos && \ |
| 28 | export ONOS_ROOT && \ |
Jonathan Hart | eb6950f | 2016-11-10 16:21:05 -0800 | [diff] [blame] | 29 | tools/build/onos-buck build onos && \ |
| 30 | cp buck-out/gen/tools/package/onos-package/onos.tar.gz /tmp/ && \ |
| 31 | cd .. && \ |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 32 | rm -rf onos && \ |
alshabib | 562fe52 | 2015-06-24 12:09:55 -0700 | [diff] [blame] | 33 | apt-get clean && apt-get purge -y && apt-get autoremove -y && \ |
| 34 | rm -rf /var/lib/apt/lists/* && \ |
Jonathan Hart | eb6950f | 2016-11-10 16:21:05 -0800 | [diff] [blame] | 35 | rm -rf /var/cache/oracle-jdk8-installer |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 36 | |
| 37 | # Change to /root directory |
| 38 | WORKDIR /root |
| 39 | |
Jonathan Hart | 77daee8 | 2017-01-16 14:29:20 -0800 | [diff] [blame] | 40 | # Install ONOS |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 41 | RUN mkdir onos && \ |
Jonathan Hart | eb6950f | 2016-11-10 16:21:05 -0800 | [diff] [blame] | 42 | mv /tmp/onos.tar.gz . && \ |
| 43 | tar -xf onos.tar.gz -C onos --strip-components=1 && \ |
| 44 | rm -rf onos.tar.gz |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 45 | |
| 46 | |
| 47 | # Ports |
Charles Chan | 45624b8 | 2015-08-24 00:29:20 +0800 | [diff] [blame] | 48 | # 6653 - OpenFlow |
Jonathan Hart | 77daee8 | 2017-01-16 14:29:20 -0800 | [diff] [blame] | 49 | # 6640 - OVSDB |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 50 | # 8181 - GUI |
| 51 | # 8101 - ONOS CLI |
| 52 | # 9876 - ONOS CLUSTER COMMUNICATION |
Jonathan Hart | 77daee8 | 2017-01-16 14:29:20 -0800 | [diff] [blame] | 53 | EXPOSE 6653 6640 8181 8101 9876 |
alshabib | 187f172 | 2015-06-23 16:15:50 -0700 | [diff] [blame] | 54 | |
| 55 | # Get ready to run command |
| 56 | WORKDIR /root/onos |
David Bainbridge | ff4fb04 | 2015-08-17 12:53:29 -0700 | [diff] [blame] | 57 | ENTRYPOINT ["./bin/onos-service"] |