blob: c4ecc44c45f539aeb531cda4edf609e924023986 [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
17# We start from an onos image and install the apps.
18# We need at least an onos image built with 'tost' profile
pierventred9cb7292020-07-31 00:01:47 +020019FROM tost-onos as install
pierventre16709162020-07-16 20:48:24 +020020
21ARG KARAF_VERSION
22ARG LOCAL_APPS
23
24# ENV settings
25ENV ONOS=/root/onos
26ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION
27ENV APPS_ROOT=${ONOS}/apps
28ENV KARAF_M2=${KARAF_ROOT}/system
29ENV DOWNLOAD_ROOT=/download
30ENV APP_INSTALL_ROOT=/expand
31
32# Copy the apps to the install stage container
33COPY $LOCAL_APPS/ ${DOWNLOAD_ROOT}/
34
35RUN apt-get update && \
36 apt-get install -y --no-install-recommends \
37 unzip && \
38 rm -rf /var/lib/apt/lists/*
39
40WORKDIR ${DOWNLOAD_ROOT}
41
42# Install the applications
43COPY app-install.sh ./app-install.sh
44RUN chmod 755 ./app-install.sh
45RUN ./app-install.sh
46
47# Create the final image coping over the installed applications from the install stage
pierventred9cb7292020-07-31 00:01:47 +020048FROM tost-onos
pierventre16709162020-07-16 20:48:24 +020049
50ARG KARAF_VERSION
51
52# The ENV settings must be replicated below as they are not shared between stages
53ENV ONOS=/root/onos
54ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION
55ENV KARAF_M2=${KARAF_ROOT}/system
56ENV APPS_ROOT=${ONOS}/apps
57
58COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
59COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
60
61# Label image
62ARG org_label_schema_version=unknown
63ARG org_label_schema_vcs_url=unknown
64ARG org_label_schema_vcs_ref=unknown
65ARG org_label_schema_build_date=unknown
66ARG org_onosproject_vcs_commit_date=unknown
67
68LABEL org.label-schema.schema-version=1.0 \
69 org.label-schema.name=tost \
70 org.label-schema.version=$org_label_schema_version \
71 org.label-schema.vcs-url=$org_label_schema_vcs_url \
72 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
73 org.label-schema.build-date=$org_label_schema_build_date \
74 org.onosproject.vcs-commit-date=$org_onosproject_vcs_commit_date