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