David K. Bainbridge | 1246305 | 2018-01-19 09:26:09 -0800 | [diff] [blame] | 1 | # Copyright 2018 the original author or authors. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 15 | FROM maven:3-jdk-8-alpine as download |
David K. Bainbridge | e098254 | 2017-08-22 10:58:49 -0700 | [diff] [blame] | 16 | MAINTAINER Open Networking Foundation <info@opennetworking.org> |
| 17 | |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 18 | #RUN apt-get update && apt-get install -y maven |
| 19 | |
| 20 | # The ENV settings must be replicated below as they are not shared between stages |
| 21 | ENV DOWNLOAD_ROOT=/download |
| 22 | |
| 23 | # Build the applications |
| 24 | RUN mkdir -p ${DOWNLOAD_ROOT} |
| 25 | WORKDIR ${DOWNLOAD_ROOT} |
Gertjan Van Droogenbroeck | cb3507d | 2017-11-16 16:54:22 +0100 | [diff] [blame] | 26 | COPY config/mvn_settings.* ${DOWNLOAD_ROOT}/ |
| 27 | RUN ./mvn_settings.sh |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 28 | ADD config/dependencies.xml . |
Gertjan Van Droogenbroeck | cb3507d | 2017-11-16 16:54:22 +0100 | [diff] [blame] | 29 | RUN mvn dependency:copy -Dmdep.useBaseVersion=true -DoutputDirectory=${DOWNLOAD_ROOT} -Dsilent=true -f dependencies.xml -s mvn_settings.xml |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 30 | |
David K. Bainbridge | 0bc5135 | 2017-11-01 15:15:38 -0700 | [diff] [blame] | 31 | FROM onosproject/onos:1.10.9 as install |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 32 | MAINTAINER Open Networking Foundation <info@opennetworking.org> |
| 33 | |
| 34 | # The ENV settings must be replicated below as they are not shared between stages |
David K. Bainbridge | e098254 | 2017-08-22 10:58:49 -0700 | [diff] [blame] | 35 | ENV ONOS=/root/onos |
David K. Bainbridge | e098254 | 2017-08-22 10:58:49 -0700 | [diff] [blame] | 36 | ENV KARAF_VERSION=3.0.8 |
| 37 | ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION} |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 38 | ENV APPS_ROOT=${ONOS}/apps |
David K. Bainbridge | e098254 | 2017-08-22 10:58:49 -0700 | [diff] [blame] | 39 | ENV KARAF_M2=${KARAF_ROOT}/system |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 40 | ENV DOWNLOAD_ROOT=/download |
David K. Bainbridge | e098254 | 2017-08-22 10:58:49 -0700 | [diff] [blame] | 41 | ENV APP_INSTALL_ROOT=/expand |
| 42 | |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 43 | # Copy the downloaded artifact to the install stage container |
| 44 | COPY --from=download ${DOWNLOAD_ROOT} ${DOWNLOAD_ROOT} |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 45 | |
| 46 | # Install the applications |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 47 | COPY config/app-install.sh ./app-install.sh |
David K. Bainbridge | f87a5c8 | 2017-08-11 11:04:57 -0700 | [diff] [blame] | 48 | RUN chmod 755 ./app-install.sh |
| 49 | RUN ./app-install.sh |
alshabib | 7db1356 | 2017-01-09 21:21:34 -0800 | [diff] [blame] | 50 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 51 | # Create the final image coping over the installed applications from the build stage |
David K. Bainbridge | 0bc5135 | 2017-11-01 15:15:38 -0700 | [diff] [blame] | 52 | FROM onosproject/onos:1.10.9 |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 53 | MAINTAINER Open Networking Foundation <info@opennetworking.org> |
alshabib | 9fbb223 | 2016-12-23 00:40:08 -0800 | [diff] [blame] | 54 | |
David K. Bainbridge | 138d5d6 | 2017-08-14 14:20:11 -0700 | [diff] [blame] | 55 | # Install Key Store Options |
| 56 | ENV JAVA_OPTS="${JAVA_OPTS:--DenableOFTLS=true -Djavax.net.ssl.keyStore=/home/sdn/wiki/onos.jks -Djavax.net.ssl.keyStorePassword=222222 -Djavax.net.ssl.trustStore=/home/sdn/wiki/onos.jks -Djavax.net.ssl.trustStorePassword=222222}" |
| 57 | |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 58 | # The ENV settings must be replicated below as they are not shared between stages |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 59 | ENV ONOS=/root/onos |
David K. Bainbridge | 6c0dc88 | 2017-08-17 09:57:10 -0700 | [diff] [blame] | 60 | ENV KARAF_VERSION=3.0.8 |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 61 | ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION} |
| 62 | ENV KARAF_M2=${KARAF_ROOT}/system |
| 63 | ENV APPS_ROOT=${ONOS}/apps |
Zsolt Haraszti | 3578a1c | 2017-01-10 15:29:02 -0800 | [diff] [blame] | 64 | |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 65 | COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/ |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 66 | RUN echo "${KARAF_M2} ${APPS_ROOT}" |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 67 | COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/ |
alshabib | 9fbb223 | 2016-12-23 00:40:08 -0800 | [diff] [blame] | 68 | COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json |
schowdhury | cbbe327 | 2017-07-03 17:12:35 -0700 | [diff] [blame] | 69 | |
David K. Bainbridge | 138d5d6 | 2017-08-14 14:20:11 -0700 | [diff] [blame] | 70 | RUN touch $ONOS/apps/org.onosproject.hostprovider/active |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 71 | RUN touch $ONOS/apps/org.onosproject.openflow-base/active |
| 72 | |
schowdhury | cbbe327 | 2017-07-03 17:12:35 -0700 | [diff] [blame] | 73 | # Create ONOS Key Directory |
| 74 | RUN mkdir -p /home/sdn/wiki |
| 75 | COPY onos_cfg/ /home/sdn/wiki |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 76 | |