blob: 6d8ce418e0612d67cc319ec52af08f611d5fe509 [file] [log] [blame]
David K. Bainbridgebba65ff2018-01-19 09:26:09 -08001# 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. Bainbridgeb6f72c12017-08-22 13:22:23 -070015FROM maven:3-jdk-8-alpine as download
David K. Bainbridgee0982542017-08-22 10:58:49 -070016MAINTAINER Open Networking Foundation <info@opennetworking.org>
17
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070018#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
21ENV DOWNLOAD_ROOT=/download
22
23# Build the applications
24RUN mkdir -p ${DOWNLOAD_ROOT}
25WORKDIR ${DOWNLOAD_ROOT}
Gertjan Van Droogenbroecke0c9acb2017-11-16 16:54:22 +010026COPY config/mvn_settings.* ${DOWNLOAD_ROOT}/
27RUN ./mvn_settings.sh
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070028ADD config/dependencies.xml .
Gertjan Van Droogenbroecke0c9acb2017-11-16 16:54:22 +010029RUN 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 -070030
David K. Bainbridge0bc51352017-11-01 15:15:38 -070031FROM onosproject/onos:1.10.9 as install
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070032MAINTAINER Open Networking Foundation <info@opennetworking.org>
33
34# The ENV settings must be replicated below as they are not shared between stages
David K. Bainbridgee0982542017-08-22 10:58:49 -070035ENV ONOS=/root/onos
David K. Bainbridgee0982542017-08-22 10:58:49 -070036ENV KARAF_VERSION=3.0.8
37ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070038ENV APPS_ROOT=${ONOS}/apps
David K. Bainbridgee0982542017-08-22 10:58:49 -070039ENV KARAF_M2=${KARAF_ROOT}/system
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070040ENV DOWNLOAD_ROOT=/download
David K. Bainbridgee0982542017-08-22 10:58:49 -070041ENV APP_INSTALL_ROOT=/expand
42
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070043# Copy the downloaded artifact to the install stage container
44COPY --from=download ${DOWNLOAD_ROOT} ${DOWNLOAD_ROOT}
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070045
46# Install the applications
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070047COPY config/app-install.sh ./app-install.sh
David K. Bainbridgef87a5c82017-08-11 11:04:57 -070048RUN chmod 755 ./app-install.sh
49RUN ./app-install.sh
alshabib7db13562017-01-09 21:21:34 -080050
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070051# Create the final image coping over the installed applications from the build stage
David K. Bainbridge0bc51352017-11-01 15:15:38 -070052FROM onosproject/onos:1.10.9
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070053MAINTAINER Open Networking Foundation <info@opennetworking.org>
alshabib9fbb2232016-12-23 00:40:08 -080054
David K. Bainbridge138d5d62017-08-14 14:20:11 -070055# Install Key Store Options
56ENV 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. Bainbridgeb6f72c12017-08-22 13:22:23 -070058# The ENV settings must be replicated below as they are not shared between stages
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070059ENV ONOS=/root/onos
David K. Bainbridge6c0dc882017-08-17 09:57:10 -070060ENV KARAF_VERSION=3.0.8
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070061ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
62ENV KARAF_M2=${KARAF_ROOT}/system
63ENV APPS_ROOT=${ONOS}/apps
Zsolt Haraszti3578a1c2017-01-10 15:29:02 -080064
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070065COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070066RUN echo "${KARAF_M2} ${APPS_ROOT}"
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070067COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
alshabib9fbb2232016-12-23 00:40:08 -080068COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json
schowdhurycbbe3272017-07-03 17:12:35 -070069
David K. Bainbridge138d5d62017-08-14 14:20:11 -070070RUN touch $ONOS/apps/org.onosproject.hostprovider/active
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070071RUN touch $ONOS/apps/org.onosproject.openflow-base/active
72
schowdhurycbbe3272017-07-03 17:12:35 -070073# Create ONOS Key Directory
74RUN mkdir -p /home/sdn/wiki
75COPY onos_cfg/ /home/sdn/wiki
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070076