blob: 609d85dcfaf91b2f3001bf7543337be34c414d9a [file] [log] [blame]
pierventre16709162020-07-16 20:48:24 +02001#
2# Copyright 2020-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
pierventredd900102020-11-06 19:23:41 +010017ARG DOCKER_TAG
18
pierventre16709162020-07-16 20:48:24 +020019# We start from an onos image and install the apps.
20# We need at least an onos image built with 'tost' profile
pierventredd900102020-11-06 19:23:41 +010021FROM tost-onos:${DOCKER_TAG} as install
pierventre16709162020-07-16 20:48:24 +020022
23ARG KARAF_VERSION
24ARG LOCAL_APPS
25
26# ENV settings
27ENV ONOS=/root/onos
28ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION
29ENV APPS_ROOT=${ONOS}/apps
30ENV KARAF_M2=${KARAF_ROOT}/system
31ENV DOWNLOAD_ROOT=/download
32ENV APP_INSTALL_ROOT=/expand
33
34# Copy the apps to the install stage container
35COPY $LOCAL_APPS/ ${DOWNLOAD_ROOT}/
36
37RUN apt-get update && \
38 apt-get install -y --no-install-recommends \
39 unzip && \
40 rm -rf /var/lib/apt/lists/*
41
42WORKDIR ${DOWNLOAD_ROOT}
43
44# Install the applications
45COPY app-install.sh ./app-install.sh
46RUN chmod 755 ./app-install.sh
47RUN ./app-install.sh
48
pierventredd900102020-11-06 19:23:41 +010049ARG DOCKER_TAG
50
pierventre16709162020-07-16 20:48:24 +020051# Create the final image coping over the installed applications from the install stage
pierventredd900102020-11-06 19:23:41 +010052FROM tost-onos:${DOCKER_TAG}
pierventre16709162020-07-16 20:48:24 +020053
54ARG KARAF_VERSION
55
56# The ENV settings must be replicated below as they are not shared between stages
57ENV ONOS=/root/onos
58ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION
59ENV KARAF_M2=${KARAF_ROOT}/system
60ENV APPS_ROOT=${ONOS}/apps
61
62COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
63COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
64
65# Label image
66ARG org_label_schema_version=unknown
67ARG org_label_schema_vcs_url=unknown
68ARG org_label_schema_vcs_ref=unknown
69ARG org_label_schema_build_date=unknown
pierventre83611422020-08-14 22:53:15 +020070ARG org_onosproject_onos_version=unknown
71ARG org_onosproject_trellis_control_version=unknown
72ARG org_onosproject_trellis_t3_version=unknown
pierventre83611422020-08-14 22:53:15 +020073ARG org_omecproject_up4_version=unknown
74ARG org_opencord_kafka_onos_version=unknown
75ARG org_stratumproject_fabric_tna_version=unknown
pierventre16709162020-07-16 20:48:24 +020076
77LABEL org.label-schema.schema-version=1.0 \
78 org.label-schema.name=tost \
79 org.label-schema.version=$org_label_schema_version \
80 org.label-schema.vcs-url=$org_label_schema_vcs_url \
81 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
82 org.label-schema.build-date=$org_label_schema_build_date \
pierventre83611422020-08-14 22:53:15 +020083 org.onosproject.onos.version=$org_onosproject_onos_version \
84 org.onosproject.trellis-control.version=$org_onosproject_trellis_control_version \
85 org.onosproject.trellis-t3.version=$org_onosproject_trellis_t3_version \
pierventre83611422020-08-14 22:53:15 +020086 org.omecproject.up4.version=$org_omecproject_up4_version \
87 org.opencord.kafka-onos.version=$org_opencord_kafka_onos_version \
88 org.stratumproject.fabric-tna.version=$org_stratumproject_fabric_tna_version