David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 1 | FROM onosproject/onos:1.8 as build |
| 2 | MAINTAINER Open Networking Foundation <info@opennetworking.org> |
alshabib | 9fbb223 | 2016-12-23 00:40:08 -0800 | [diff] [blame] | 3 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 4 | # Install and configure build tools |
schowdhury | cbbe327 | 2017-07-03 17:12:35 -0700 | [diff] [blame] | 5 | ENV JAVA_OPTS="${JAVA_OPTS:--DenableOFTLS=true -Djavax.net.ssl.keyStore=/home/sdn/wiki/onos.jks -Djavax.net.ssl.keyStorePassword=222222 -Djavax.net.ssl.trustStore=/home/sdn/wiki/onos.jks -Djavax.net.ssl.trustStorePassword=222222}" |
| 6 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 7 | RUN apt-get update && apt-get install -y git maven unzip curl python |
| 8 | RUN curl -sSL http://commondatastorage.googleapis.com/git-repo-downloads/repo -o /bin/repo && chmod 755 /bin/repo |
alshabib | 7db1356 | 2017-01-09 21:21:34 -0800 | [diff] [blame] | 9 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 10 | # The ENV settings for ONOS, KARAF_VERSION, KARAF_ROOT, KARAF_M2, and APPS_ROOT |
| 11 | # must be replicated below to the final image as they are shared between stages |
| 12 | ENV ONOS=/root/onos |
| 13 | ENV APPS_ROOT=${ONOS}/apps |
| 14 | ENV KARAF_VERSION=3.0.5 |
| 15 | ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION} |
| 16 | ENV KARAF_M2=${KARAF_ROOT}/system |
| 17 | ENV MANIFEST_BRANCH=master |
| 18 | ENV BUILD_ROOT=/build |
| 19 | ENV APP_INSTALL_ROOT=/expand |
alshabib | 7db1356 | 2017-01-09 21:21:34 -0800 | [diff] [blame] | 20 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 21 | # Build the applications |
| 22 | RUN mkdir -p ${BUILD_ROOT} |
| 23 | WORKDIR ${BUILD_ROOT} |
| 24 | RUN repo init -u http://gerrit.opencord.org/manifest -b ${MANIFEST_BRANCH} -g onos && repo sync |
| 25 | WORKDIR ${BUILD_ROOT}/onos-apps/apps |
| 26 | RUN mvn -DskipTests=true clean install |
| 27 | |
| 28 | # Specify application versions to install |
| 29 | ENV AAA_VERSION=1.2.0-SNAPSHOT \ |
| 30 | CONFIG_VERSION=1.2.0-SNAPSHOT \ |
| 31 | IGMP_VERSION=1.2.0-SNAPSHOT \ |
| 32 | IGMP_PROXY_VERSION=1.0.0-SNAPSHOT \ |
| 33 | MCAST_VERSION=1.2.0-SNAPSHOT \ |
| 34 | OLT_VERSION=1.2.0-SNAPSHOT \ |
| 35 | SADIS_VERSION=1.0.0-SNAPSHOT \ |
| 36 | VTN_VERSION=1.2.0-SNAPSHOT \ |
| 37 | L2_DHCP_RELAY_VERSION=1.0.0-SNAPSHOT |
| 38 | |
| 39 | ENV APPS="aaa-${AAA_VERSION} \ |
| 40 | cord-config-${CONFIG_VERSION} \ |
| 41 | igmp-${IGMP_VERSION} \ |
| 42 | mcast-${MCAST_VERSION} \ |
| 43 | olt-app-${OLT_VERSION} \ |
| 44 | sadis-app-${SADIS_VERSION} \ |
| 45 | vtn-${VTN_VERSION} \ |
| 46 | aaa-${AAA_VERSION} \ |
| 47 | onos-app-igmpproxy-${IGMP_PROXY_VERSION} \ |
| 48 | dhcpl2relay-${L2_DHCP_RELAY_VERSION}" |
| 49 | |
| 50 | # Install the applications |
alshabib | 7db1356 | 2017-01-09 21:21:34 -0800 | [diff] [blame] | 51 | COPY config/app-install.sh . |
David K. Bainbridge | f87a5c8 | 2017-08-11 11:04:57 -0700 | [diff] [blame] | 52 | RUN chmod 755 ./app-install.sh |
| 53 | RUN ./app-install.sh |
alshabib | 7db1356 | 2017-01-09 21:21:34 -0800 | [diff] [blame] | 54 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 55 | # Create the final image coping over the installed applications from the build stage |
| 56 | FROM onosproject/onos:1.8 |
alshabib | 9fbb223 | 2016-12-23 00:40:08 -0800 | [diff] [blame] | 57 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 58 | ENV ONOS=/root/onos |
| 59 | ENV KARAF_VERSION=3.0.5 |
| 60 | ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION} |
| 61 | ENV KARAF_M2=${KARAF_ROOT}/system |
| 62 | ENV APPS_ROOT=${ONOS}/apps |
Zsolt Haraszti | 3578a1c | 2017-01-10 15:29:02 -0800 | [diff] [blame] | 63 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 64 | COPY --from=build ${KARAF_M2}/ ${KARAF_M2}/ |
| 65 | RUN echo "${KARAF_M2} ${APPS_ROOT}" |
| 66 | COPY --from=build ${APPS_ROOT}/ ${APPS_ROOT}/ |
alshabib | 9fbb223 | 2016-12-23 00:40:08 -0800 | [diff] [blame] | 67 | COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json |
schowdhury | cbbe327 | 2017-07-03 17:12:35 -0700 | [diff] [blame] | 68 | |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 69 | RUN touch $ONOS/apps/org.onosproject.netcfghostprovider/active |
| 70 | RUN touch $ONOS/apps/org.onosproject.netcfglinksprovider/active |
| 71 | RUN touch $ONOS/apps/org.onosproject.openflow-base/active |
| 72 | |
schowdhury | cbbe327 | 2017-07-03 17:12:35 -0700 | [diff] [blame] | 73 | # Create ONOS Key Directory |
| 74 | RUN mkdir -p /home/sdn/wiki |
| 75 | COPY onos_cfg/ /home/sdn/wiki |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 76 | |