Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame^] | 1 | # Prepare stage for multistage image build |
| 2 | ## START OF STAGE0 ## |
| 3 | FROM ${base.image.name}:${project.docker.latestfulltag.version} AS stage0 |
| 4 | |
| 5 | ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk |
| 6 | ENV ODL_HOME /opt/opendaylight |
| 7 | |
| 8 | # copy the opendaylight credentials |
| 9 | COPY idmlight.db.mv.db $ODL_HOME/data |
| 10 | |
| 11 | # copy CCSDK mvn artifacts to ODL repository |
| 12 | COPY system /tmp/system |
| 13 | RUN rsync -a /tmp/system $ODL_HOME |
| 14 | |
| 15 | # copy deliverables to opt |
| 16 | COPY opt /opt |
| 17 | COPY org.ops4j.pax.logging.cfg $ODL_HOME/etc/org.ops4j.pax.logging.cfg |
| 18 | ## END OF STAGE0 ## |
| 19 | |
| 20 | |
| 21 | FROM ${base.image.name}:${project.docker.latestfulltag.version} |
| 22 | |
| 23 | MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org) |
| 24 | |
| 25 | ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk |
| 26 | ENV ODL_HOME /opt/opendaylight |
| 27 | ENV SDNC_CONFIG_DIR /opt/onap/ccsdk/data/properties |
| 28 | ENV CCSDK_SLI_CORE_REPO mvn:org.onap.ccsdk.sli.core/ccsdk-sli-core-all/${ccsdk.sli.core.version}/xml/features |
| 29 | ENV CCSDK_SLI_ADAPTORS_REPO mvn:org.onap.ccsdk.sli.adaptors/ccsdk-sli-adaptors-all/${ccsdk.sli.adaptors.version}/xml/features |
| 30 | ENV CCSDK_FEATURES_REPO mvn:org.onap.ccsdk.features/ccsdk-features-all/${ccsdk.features.version}/xml/features |
| 31 | ENV CCSDK_FEATURES_SDNR_WT_REPO mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator/${ccsdk.features.version}/xml/features |
| 32 | ENV CCSDK_SLI_NORTHBOUND_REPO mvn:org.onap.ccsdk.sli.northbound/ccsdk-sli-northbound-all/${ccsdk.sli.northbound.version}/xml/features |
| 33 | ENV CCSDK_SLI_PLUGINS_REPO mvn:org.onap.ccsdk.sli.plugins/ccsdk-sli-plugins-all/${ccsdk.sli.plugins.version}/xml/features |
| 34 | ENV ANSIBLE_GPG_KEY ${ansible.gpg.key} |
| 35 | ENV ODL_BOOT_FEATURES_EXTRA ${odl.boot.features.extra} |
| 36 | |
| 37 | # Install sudo and IP utilities |
| 38 | RUN apk update && apk --no-cache add sudo iputils openssl |
| 39 | |
| 40 | |
| 41 | # Enable wheel group |
| 42 | RUN sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers |
| 43 | |
| 44 | # Create odl user |
| 45 | RUN addgroup -S odl && adduser -S odl -G odl |
| 46 | RUN addgroup odl wheel |
| 47 | |
| 48 | COPY --from=stage0 --chown=odl:odl /opt /opt |
| 49 | |
| 50 | # Add CCSDK repositories to boot repositories |
| 51 | RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig |
| 52 | RUN sed -i -e "\|featuresRepositories|s|$|, ${CCSDK_SLI_CORE_REPO}, ${CCSDK_SLI_ADAPTORS_REPO}, ${CCSDK_SLI_NORTHBOUND_REPO}, ${CCSDK_SLI_PLUGINS_REPO}, ${CCSDK_FEATURES_REPO}|" $ODL_HOME/etc/org.apache.karaf.features.cfg |
| 53 | RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,${ODL_BOOT_FEATURES_EXTRA}|" $ODL_HOME/etc/org.apache.karaf.features.cfg |
| 54 | |
| 55 | USER odl |
| 56 | ENTRYPOINT /opt/onap/ccsdk/bin/startODL.sh |
| 57 | EXPOSE 8181 |