blob: 528d90bf5d77842ecc9342b9bf9d933694d57256 [file] [log] [blame]
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -07001FROM maven:3-jdk-8-alpine as download
David K. Bainbridgee0982542017-08-22 10:58:49 -07002MAINTAINER Open Networking Foundation <info@opennetworking.org>
3
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -07004#RUN apt-get update && apt-get install -y maven
5
6# The ENV settings must be replicated below as they are not shared between stages
7ENV DOWNLOAD_ROOT=/download
8
9# Build the applications
10RUN mkdir -p ${DOWNLOAD_ROOT}
11WORKDIR ${DOWNLOAD_ROOT}
Gertjan Van Droogenbroeckcb3507d2017-11-16 16:54:22 +010012COPY config/mvn_settings.* ${DOWNLOAD_ROOT}/
13RUN ./mvn_settings.sh
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070014ADD config/dependencies.xml .
Gertjan Van Droogenbroeckcb3507d2017-11-16 16:54:22 +010015RUN mvn dependency:copy -Dmdep.useBaseVersion=true -DoutputDirectory=${DOWNLOAD_ROOT} -Dsilent=true -f dependencies.xml -s mvn_settings.xml
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070016
David K. Bainbridge0bc51352017-11-01 15:15:38 -070017FROM onosproject/onos:1.10.9 as install
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070018MAINTAINER Open Networking Foundation <info@opennetworking.org>
19
20# The ENV settings must be replicated below as they are not shared between stages
David K. Bainbridgee0982542017-08-22 10:58:49 -070021ENV ONOS=/root/onos
David K. Bainbridgee0982542017-08-22 10:58:49 -070022ENV KARAF_VERSION=3.0.8
23ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070024ENV APPS_ROOT=${ONOS}/apps
David K. Bainbridgee0982542017-08-22 10:58:49 -070025ENV KARAF_M2=${KARAF_ROOT}/system
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070026ENV DOWNLOAD_ROOT=/download
David K. Bainbridgee0982542017-08-22 10:58:49 -070027ENV APP_INSTALL_ROOT=/expand
28
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070029# Copy the downloaded artifact to the install stage container
30COPY --from=download ${DOWNLOAD_ROOT} ${DOWNLOAD_ROOT}
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070031
32# Install the applications
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070033COPY config/app-install.sh ./app-install.sh
David K. Bainbridgef87a5c82017-08-11 11:04:57 -070034RUN chmod 755 ./app-install.sh
35RUN ./app-install.sh
alshabib7db13562017-01-09 21:21:34 -080036
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070037# Create the final image coping over the installed applications from the build stage
David K. Bainbridge0bc51352017-11-01 15:15:38 -070038FROM onosproject/onos:1.10.9
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070039MAINTAINER Open Networking Foundation <info@opennetworking.org>
alshabib9fbb2232016-12-23 00:40:08 -080040
David K. Bainbridge138d5d62017-08-14 14:20:11 -070041# Install Key Store Options
42ENV 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}"
43
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070044# The ENV settings must be replicated below as they are not shared between stages
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070045ENV ONOS=/root/onos
David K. Bainbridge6c0dc882017-08-17 09:57:10 -070046ENV KARAF_VERSION=3.0.8
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070047ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
48ENV KARAF_M2=${KARAF_ROOT}/system
49ENV APPS_ROOT=${ONOS}/apps
Zsolt Haraszti3578a1c2017-01-10 15:29:02 -080050
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070051COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070052RUN echo "${KARAF_M2} ${APPS_ROOT}"
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070053COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
alshabib9fbb2232016-12-23 00:40:08 -080054COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json
schowdhurycbbe3272017-07-03 17:12:35 -070055
David K. Bainbridge138d5d62017-08-14 14:20:11 -070056RUN touch $ONOS/apps/org.onosproject.hostprovider/active
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070057RUN touch $ONOS/apps/org.onosproject.openflow-base/active
58
schowdhurycbbe3272017-07-03 17:12:35 -070059# Create ONOS Key Directory
60RUN mkdir -p /home/sdn/wiki
61COPY onos_cfg/ /home/sdn/wiki
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070062