Jonathan Hart | ca512e1 | 2018-02-24 10:36:29 -0800 | [diff] [blame^] | 1 | # Builds an ONOS docker image from a prebuilt tar.gz file. |
| 2 | # tar.gz must be located in your onos directory at |
| 3 | # buck-out/gen/tools/package/onos-package/onos.tar.gz |
| 4 | |
| 5 | FROM anapsix/alpine-java:8_server-jre |
| 6 | |
| 7 | # Change to /root directory |
| 8 | RUN apk update && \ |
| 9 | apk add curl && \ |
| 10 | apk --update add tar && \ |
| 11 | mkdir -p /root/onos |
| 12 | WORKDIR /root/onos |
| 13 | |
| 14 | # Install ONOS |
| 15 | COPY buck-out/gen/tools/package/onos-package/onos.tar.gz . |
| 16 | RUN tar -xzvf onos.tar.gz --strip-components=1 |
| 17 | |
| 18 | # Configure ONOS to log to stdout |
| 19 | RUN sed -ibak '/log4j.rootLogger=/s/$/, stdout/' $(ls -d apache-karaf-*)/etc/org.ops4j.pax.logging.cfg |
| 20 | |
| 21 | LABEL org.label-schema.name="ONOS" \ |
| 22 | org.label-schema.description="SDN Controller" \ |
| 23 | org.label-schema.usage="http://wiki.onosproject.org" \ |
| 24 | org.label-schema.url="http://onosproject.org" \ |
| 25 | org.label-scheme.vendor="Open Networking Foundation" \ |
| 26 | org.label-schema.schema-version="1.0" |
| 27 | |
| 28 | # Ports |
| 29 | # 6653 - OpenFlow |
| 30 | # 6640 - OVSDB |
| 31 | # 8181 - GUI |
| 32 | # 8101 - ONOS CLI |
| 33 | # 9876 - ONOS intra-cluster communication |
| 34 | EXPOSE 6653 6640 8181 8101 9876 |
| 35 | |
| 36 | # Get ready to run command |
| 37 | ENTRYPOINT ["./bin/onos-service"] |
| 38 | CMD ["server"] |