blob: 5973b4356740753d06cf0d035b657f188ab9e4e0 [file] [log] [blame]
# Copyright 2018 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM maven:3-jdk-8-alpine as download
MAINTAINER Open Networking Foundation <info@opennetworking.org>
#RUN apt-get update && apt-get install -y maven
# The ENV settings must be replicated below as they are not shared between stages
ENV DOWNLOAD_ROOT=/download
# Build the applications
RUN mkdir -p ${DOWNLOAD_ROOT}
WORKDIR ${DOWNLOAD_ROOT}
COPY config/mvn_settings.* ${DOWNLOAD_ROOT}/
RUN ./mvn_settings.sh
ADD config/dependencies.xml .
RUN mvn dependency:copy -Dmdep.useBaseVersion=true -DoutputDirectory=${DOWNLOAD_ROOT} -Dsilent=true -f dependencies.xml -s mvn_settings.xml
FROM onosproject/onos:1.13.9 as install
MAINTAINER Open Networking Foundation <info@opennetworking.org>
# The ENV settings must be replicated below as they are not shared between stages
ENV ONOS=/root/onos
ENV KARAF_VERSION=3.0.8
ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
ENV APPS_ROOT=${ONOS}/apps
ENV KARAF_M2=${KARAF_ROOT}/system
ENV DOWNLOAD_ROOT=/download
ENV APP_INSTALL_ROOT=/expand
# Copy the downloaded artifact to the install stage container
COPY --from=download ${DOWNLOAD_ROOT} ${DOWNLOAD_ROOT}
# Install the applications
COPY config/app-install.sh ./app-install.sh
RUN chmod 755 ./app-install.sh
RUN ./app-install.sh
# Create the final image coping over the installed applications from the build stage
FROM onosproject/onos:1.13.9-rc4
MAINTAINER Open Networking Foundation <info@opennetworking.org>
# The ENV settings must be replicated below as they are not shared between stages
ENV ONOS=/root/onos
ENV KARAF_VERSION=3.0.8
ENV KARAF_ROOT=${ONOS}/apache-karaf-${KARAF_VERSION}
ENV KARAF_M2=${KARAF_ROOT}/system
ENV APPS_ROOT=${ONOS}/apps
COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
RUN echo "${KARAF_M2} ${APPS_ROOT}"
COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
COPY config/netcfg.json $KARAF_ROOT/../config/network-cfg.json
RUN touch $ONOS/apps/org.onosproject.hostprovider/active
RUN touch $ONOS/apps/org.onosproject.openflow-base/active
# Create ONOS Key Directory
RUN mkdir -p /home/sdn/wiki
COPY onos_cfg/ /home/sdn/wiki