blob: 3a4516f18117d4fe8b3a9114370d9850bb2cf8e0 [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
Carmelo Cascone68528e82022-02-04 18:42:34 -080019# We start from a base onos image and install the apps.
20FROM onos-base:${DOCKER_TAG} as install
pierventre16709162020-07-16 20:48:24 +020021
22ARG KARAF_VERSION
23ARG LOCAL_APPS
24
25# ENV settings
26ENV ONOS=/root/onos
27ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION
28ENV APPS_ROOT=${ONOS}/apps
29ENV KARAF_M2=${KARAF_ROOT}/system
30ENV DOWNLOAD_ROOT=/download
31ENV APP_INSTALL_ROOT=/expand
32
33# Copy the apps to the install stage container
34COPY $LOCAL_APPS/ ${DOWNLOAD_ROOT}/
35
36RUN apt-get update && \
37 apt-get install -y --no-install-recommends \
38 unzip && \
39 rm -rf /var/lib/apt/lists/*
40
41WORKDIR ${DOWNLOAD_ROOT}
42
43# Install the applications
44COPY app-install.sh ./app-install.sh
45RUN chmod 755 ./app-install.sh
46RUN ./app-install.sh
47
pierventredd900102020-11-06 19:23:41 +010048ARG DOCKER_TAG
49
pierventre16709162020-07-16 20:48:24 +020050# Create the final image coping over the installed applications from the install stage
Carmelo Cascone68528e82022-02-04 18:42:34 -080051FROM onos-base:${DOCKER_TAG}
pierventre16709162020-07-16 20:48:24 +020052
53ARG KARAF_VERSION
54
55# The ENV settings must be replicated below as they are not shared between stages
56ENV ONOS=/root/onos
57ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION
58ENV KARAF_M2=${KARAF_ROOT}/system
59ENV APPS_ROOT=${ONOS}/apps
60
61COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
62COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
63
64# Label image
65ARG org_label_schema_version=unknown
66ARG org_label_schema_vcs_url=unknown
67ARG org_label_schema_vcs_ref=unknown
68ARG org_label_schema_build_date=unknown
pierventre83611422020-08-14 22:53:15 +020069ARG org_onosproject_onos_version=unknown
70ARG org_onosproject_trellis_control_version=unknown
71ARG org_onosproject_trellis_t3_version=unknown
pierventre83611422020-08-14 22:53:15 +020072ARG org_omecproject_up4_version=unknown
pierventre83611422020-08-14 22:53:15 +020073ARG org_stratumproject_fabric_tna_version=unknown
pierventre16709162020-07-16 20:48:24 +020074
75LABEL org.label-schema.schema-version=1.0 \
Carmelo Cascone68528e82022-02-04 18:42:34 -080076 org.label-schema.name=sdfabric-onos \
pierventre16709162020-07-16 20:48:24 +020077 org.label-schema.version=$org_label_schema_version \
78 org.label-schema.vcs-url=$org_label_schema_vcs_url \
79 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
80 org.label-schema.build-date=$org_label_schema_build_date \
pierventre83611422020-08-14 22:53:15 +020081 org.onosproject.onos.version=$org_onosproject_onos_version \
82 org.onosproject.trellis-control.version=$org_onosproject_trellis_control_version \
83 org.onosproject.trellis-t3.version=$org_onosproject_trellis_t3_version \
pierventre83611422020-08-14 22:53:15 +020084 org.omecproject.up4.version=$org_omecproject_up4_version \
pierventre83611422020-08-14 22:53:15 +020085 org.stratumproject.fabric-tna.version=$org_stratumproject_fabric_tna_version