pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 1 | # |
| 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 | |
pierventre | dd90010 | 2020-11-06 19:23:41 +0100 | [diff] [blame^] | 17 | ARG DOCKER_TAG |
| 18 | |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 19 | # We start from an onos image and install the apps. |
| 20 | # We need at least an onos image built with 'tost' profile |
pierventre | dd90010 | 2020-11-06 19:23:41 +0100 | [diff] [blame^] | 21 | FROM tost-onos:${DOCKER_TAG} as install |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 22 | |
| 23 | ARG KARAF_VERSION |
| 24 | ARG LOCAL_APPS |
| 25 | |
| 26 | # ENV settings |
| 27 | ENV ONOS=/root/onos |
| 28 | ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION |
| 29 | ENV APPS_ROOT=${ONOS}/apps |
| 30 | ENV KARAF_M2=${KARAF_ROOT}/system |
| 31 | ENV DOWNLOAD_ROOT=/download |
| 32 | ENV APP_INSTALL_ROOT=/expand |
| 33 | |
| 34 | # Copy the apps to the install stage container |
| 35 | COPY $LOCAL_APPS/ ${DOWNLOAD_ROOT}/ |
| 36 | |
| 37 | RUN apt-get update && \ |
| 38 | apt-get install -y --no-install-recommends \ |
| 39 | unzip && \ |
| 40 | rm -rf /var/lib/apt/lists/* |
| 41 | |
| 42 | WORKDIR ${DOWNLOAD_ROOT} |
| 43 | |
| 44 | # Install the applications |
| 45 | COPY app-install.sh ./app-install.sh |
| 46 | RUN chmod 755 ./app-install.sh |
| 47 | RUN ./app-install.sh |
| 48 | |
pierventre | dd90010 | 2020-11-06 19:23:41 +0100 | [diff] [blame^] | 49 | ARG DOCKER_TAG |
| 50 | |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 51 | # Create the final image coping over the installed applications from the install stage |
pierventre | dd90010 | 2020-11-06 19:23:41 +0100 | [diff] [blame^] | 52 | FROM tost-onos:${DOCKER_TAG} |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 53 | |
| 54 | ARG KARAF_VERSION |
| 55 | |
| 56 | # The ENV settings must be replicated below as they are not shared between stages |
| 57 | ENV ONOS=/root/onos |
| 58 | ENV KARAF_ROOT=${ONOS}/apache-karaf-$KARAF_VERSION |
| 59 | ENV KARAF_M2=${KARAF_ROOT}/system |
| 60 | ENV APPS_ROOT=${ONOS}/apps |
| 61 | |
| 62 | COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/ |
| 63 | COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/ |
| 64 | |
| 65 | # Label image |
| 66 | ARG org_label_schema_version=unknown |
| 67 | ARG org_label_schema_vcs_url=unknown |
| 68 | ARG org_label_schema_vcs_ref=unknown |
| 69 | ARG org_label_schema_build_date=unknown |
pierventre | 8361142 | 2020-08-14 22:53:15 +0200 | [diff] [blame] | 70 | ARG org_onosproject_onos_version=unknown |
| 71 | ARG org_onosproject_trellis_control_version=unknown |
| 72 | ARG org_onosproject_trellis_t3_version=unknown |
| 73 | ARG org_opencord_fabric_tofino_version=unknown |
| 74 | ARG org_omecproject_up4_version=unknown |
| 75 | ARG org_opencord_kafka_onos_version=unknown |
| 76 | ARG org_stratumproject_fabric_tna_version=unknown |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 77 | |
| 78 | LABEL org.label-schema.schema-version=1.0 \ |
| 79 | org.label-schema.name=tost \ |
| 80 | org.label-schema.version=$org_label_schema_version \ |
| 81 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 82 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 83 | org.label-schema.build-date=$org_label_schema_build_date \ |
pierventre | 8361142 | 2020-08-14 22:53:15 +0200 | [diff] [blame] | 84 | org.onosproject.onos.version=$org_onosproject_onos_version \ |
| 85 | org.onosproject.trellis-control.version=$org_onosproject_trellis_control_version \ |
| 86 | org.onosproject.trellis-t3.version=$org_onosproject_trellis_t3_version \ |
| 87 | org.opencord.fabric-tofino.version=$org_opencord_fabric_tofino_version \ |
| 88 | org.omecproject.up4.version=$org_omecproject_up4_version \ |
| 89 | org.opencord.kafka-onos.version=$org_opencord_kafka_onos_version \ |
| 90 | org.stratumproject.fabric-tna.version=$org_stratumproject_fabric_tna_version |