blob: 51f418a61eb2e7a221b98e847c2b6a43c7469154 [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
Andy Bavier8bae0202019-07-08 13:28:00 -070031FROM onosproject/onos:1.13.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
Shad Ansarica340cd2019-05-01 14:10:37 -070052FROM matteoscandolo/onos:1.13.9-rc4
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070053MAINTAINER Open Networking Foundation <info@opennetworking.org>
alshabib9fbb2232016-12-23 00:40:08 -080054
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070055# The ENV settings must be replicated below as they are not shared between stages
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070056ENV ONOS=/root/onos
David K. Bainbridge6c0dc882017-08-17 09:57:10 -070057ENV KARAF_VERSION=3.0.8
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070058ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
59ENV KARAF_M2=${KARAF_ROOT}/system
60ENV APPS_ROOT=${ONOS}/apps
Zsolt Haraszti3578a1c2017-01-10 15:29:02 -080061
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070062COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070063RUN echo "${KARAF_M2} ${APPS_ROOT}"
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070064COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
alshabib9fbb2232016-12-23 00:40:08 -080065COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json
schowdhurycbbe3272017-07-03 17:12:35 -070066
David K. Bainbridge138d5d62017-08-14 14:20:11 -070067RUN touch $ONOS/apps/org.onosproject.hostprovider/active
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070068RUN touch $ONOS/apps/org.onosproject.openflow-base/active
69
schowdhurycbbe3272017-07-03 17:12:35 -070070# Create ONOS Key Directory
71RUN mkdir -p /home/sdn/wiki
72COPY onos_cfg/ /home/sdn/wiki