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