David K. Bainbridge | 251024b | 2017-08-10 09:11:23 -0700 | [diff] [blame] | 1 | FROM onosproject/onos:1.8 as build |
| 2 | MAINTAINER Open Networking Foundation <info@opennetworking.org> |
| 3 | |
| 4 | ENV BUILD_ROOT=/build |
| 5 | |
| 6 | COPY apps/ /build |
| 7 | |
| 8 | # The ENV settings for ONOS, KARAF_VERSION, KARAF_ROOT, KARAF_M2, and APPS_ROOT |
| 9 | # must be replicated below to the final image as they are shared between stages |
| 10 | ENV ONOS=/root/onos |
| 11 | ENV APPS_ROOT=${ONOS}/apps |
| 12 | ENV KARAF_VERSION=3.0.5 |
| 13 | ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION} |
| 14 | ENV KARAF_M2=${KARAF_ROOT}/system |
| 15 | ENV APP_INSTALL_ROOT=/expand |
| 16 | |
| 17 | # Specify application versions to install |
| 18 | ENV AAA_VERSION=1.2.0-SNAPSHOT \ |
| 19 | CONFIG_VERSION=1.2.0-SNAPSHOT \ |
| 20 | IGMP_VERSION=1.2.0-SNAPSHOT \ |
| 21 | IGMP_PROXY_VERSION=1.0.0-SNAPSHOT \ |
| 22 | MCAST_VERSION=1.2.0-SNAPSHOT \ |
| 23 | OLT_VERSION=1.2.0-SNAPSHOT \ |
| 24 | SADIS_VERSION=1.0.0-SNAPSHOT \ |
| 25 | VTN_VERSION=1.2.0-SNAPSHOT \ |
| 26 | L2_DHCP_RELAY_VERSION=1.0.0-SNAPSHOT |
| 27 | |
| 28 | ENV APPS="aaa-${AAA_VERSION} \ |
| 29 | cord-config-${CONFIG_VERSION} \ |
| 30 | igmp-${IGMP_VERSION} \ |
| 31 | mcast-${MCAST_VERSION} \ |
| 32 | olt-app-${OLT_VERSION} \ |
| 33 | sadis-app-${SADIS_VERSION} \ |
| 34 | vtn-${VTN_VERSION} \ |
| 35 | aaa-${AAA_VERSION} \ |
| 36 | onos-app-igmpproxy-${IGMP_PROXY_VERSION} \ |
| 37 | dhcpl2relay-${L2_DHCP_RELAY_VERSION}" |
| 38 | |
| 39 | # Install the applications |
| 40 | COPY config/app-install.sh . |
David K. Bainbridge | e26c870 | 2017-08-11 11:04:39 -0700 | [diff] [blame] | 41 | RUN chmod 755 ./app-install.sh |
| 42 | RUN ./app-install.sh |
David K. Bainbridge | 251024b | 2017-08-10 09:11:23 -0700 | [diff] [blame] | 43 | |
| 44 | # Create the final image coping over the installed applications from the build stage |
| 45 | FROM onosproject/onos:1.8 |
| 46 | |
| 47 | ENV ONOS=/root/onos |
| 48 | ENV KARAF_VERSION=3.0.5 |
| 49 | ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION} |
| 50 | ENV KARAF_M2=${KARAF_ROOT}/system |
| 51 | ENV APPS_ROOT=${ONOS}/apps |
| 52 | |
| 53 | COPY --from=build ${KARAF_M2}/ ${KARAF_M2}/ |
| 54 | RUN echo "${KARAF_M2} ${APPS_ROOT}" |
| 55 | COPY --from=build ${APPS_ROOT}/ ${APPS_ROOT}/ |
| 56 | COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json |
| 57 | |
| 58 | RUN touch $ONOS/apps/org.onosproject.netcfghostprovider/active |
| 59 | RUN touch $ONOS/apps/org.onosproject.netcfglinksprovider/active |
| 60 | RUN touch $ONOS/apps/org.onosproject.openflow-base/active |
| 61 | |