blob: 9c7c18698a87bd9047fb640d13851bbb1ea5b6cc [file] [log] [blame]
Matt Jeanneretc7b437c2019-05-13 12:33:08 -04001# 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
15
16# Download and copy the specified onos apps
Matt Jeanneret16d972a2019-05-21 05:43:09 -040017FROM maven:3.6.1-jdk-8-alpine as download
Matt Jeanneretc7b437c2019-05-13 12:33:08 -040018
19# The ENV settings must be replicated below as they are not shared between stages
20ENV DOWNLOAD_ROOT=/download
21RUN mkdir -p ${DOWNLOAD_ROOT}
22WORKDIR ${DOWNLOAD_ROOT}
23COPY mvn_settings.* ${DOWNLOAD_ROOT}/
24RUN ./mvn_settings.sh
25ADD dependencies.xml .
26
27ARG LOCAL_ONOSAPPS
28COPY local_imports/ /local_imports/
29RUN if [ -n "$LOCAL_ONOSAPPS" ] ; then \
30 cp /local_imports/oar/* ${DOWNLOAD_ROOT}/ ; \
31else \
32 mvn dependency:copy -Dmdep.useBaseVersion=true -DoutputDirectory=${DOWNLOAD_ROOT} -Dsilent=true -f dependencies.xml -s mvn_settings.xml ; \
33fi
34
35
36# Unpack and install specific apps from download stage
Matt Jeanneret38995f22019-08-02 14:22:40 -040037FROM onosproject/onos:1.13.9 as install
Matt Jeanneretc7b437c2019-05-13 12:33:08 -040038
39# The ENV settings must be replicated below as they are not shared between stages
40ENV ONOS=/root/onos
41ENV KARAF_VERSION=3.0.8
42ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
43ENV APPS_ROOT=${ONOS}/apps
44ENV KARAF_M2=${KARAF_ROOT}/system
45ENV DOWNLOAD_ROOT=/download
46ENV APP_INSTALL_ROOT=/expand
47
48# Copy the downloaded artifact to the install stage container
49COPY --from=download ${DOWNLOAD_ROOT} ${DOWNLOAD_ROOT}
50
51# Install the applications
52COPY app-install.sh ./app-install.sh
53RUN chmod 755 ./app-install.sh
54RUN ./app-install.sh
55
56
57# Create the final image coping over the installed applications from the install stage
Matt Jeanneret38995f22019-08-02 14:22:40 -040058FROM onosproject/onos:1.13.9
Matt Jeanneretc7b437c2019-05-13 12:33:08 -040059
60# The ENV settings must be replicated below as they are not shared between stages
61ENV ONOS=/root/onos
62ENV KARAF_VERSION=3.0.8
63ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
64ENV KARAF_M2=${KARAF_ROOT}/system
65ENV APPS_ROOT=${ONOS}/apps
66
67COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
68RUN echo "${KARAF_M2} ${APPS_ROOT}"
69COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
70COPY network-cfg.json $KARAF_ROOT/../config/network-cfg.json
71
72RUN touch $ONOS/apps/org.onosproject.hostprovider/active
73RUN touch $ONOS/apps/org.onosproject.openflow-base/active
Matteo Scandolo884a70c2019-10-29 14:58:33 -070074RUN touch $ONOS/apps/org.onosproject.lldpprovider/active
Matt Jeanneretc7b437c2019-05-13 12:33:08 -040075
76# Label image
Matt Jeanneretc7b437c2019-05-13 12:33:08 -040077ARG org_label_schema_version=unknown
78ARG org_label_schema_vcs_url=unknown
79ARG org_label_schema_vcs_ref=unknown
80ARG org_label_schema_build_date=unknown
81ARG org_opencord_vcs_commit_date=unknown
82
83LABEL org.label-schema.schema-version=1.0 \
Matt Jeanneretd8c37942019-05-14 18:06:50 -040084 org.label-schema.name=voltha-onos \
Matt Jeanneretc7b437c2019-05-13 12:33:08 -040085 org.label-schema.version=$org_label_schema_version \
86 org.label-schema.vcs-url=$org_label_schema_vcs_url \
87 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
88 org.label-schema.build-date=$org_label_schema_build_date \
89 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date