blob: fd3cd0c66190b9c40f4183cbe671437300b33b0d [file] [log] [blame]
Matej Klottonc6f21be2019-06-28 17:33:36 +02001# 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
Timoney, Dan (dt5972)268c4ba2019-02-12 14:35:10 -050021FROM ${base.image.name}:${project.docker.latestfulltag.version}
Matej Klottonc6f21be2019-06-28 17:33:36 +020022
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040023MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
Matej Klottonc6f21be2019-06-28 17:33:36 +020024
Timoney, Dan (dt5972)b1ac7252018-12-14 13:00:43 -050025ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040026ENV ODL_HOME /opt/opendaylight
Timoney, Dan (dt5972)21821db2018-03-13 19:26:40 -040027ENV SDNC_CONFIG_DIR /opt/onap/ccsdk/data/properties
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040028ENV 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
Alexis de Talhouƫt268c5e12018-09-12 15:27:33 -040030ENV CCSDK_FEATURES_REPO mvn:org.onap.ccsdk.features/ccsdk-features-all/${ccsdk.features.version}/xml/features
Herbert Eiselt4b054f92019-03-26 20:40:49 +010031ENV CCSDK_FEATURES_SDNR_WT_REPO mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator/${ccsdk.features.version}/xml/features
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040032ENV 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
RehanRaza600b9442020-08-24 15:43:29 +020034ENV A1ADAPTER_NORTHBOUND_REPO mvn:org.onap.ccsdk.oran/a1-adapter-northbound/${ccsdk.oran.a1adapter.version}/xml/features
Timoney, Dan (dt5972)be94cc12018-07-02 18:02:35 -040035ENV ANSIBLE_GPG_KEY ${ansible.gpg.key}
Timoney, Dan (dt5972)aa9d8252019-02-04 18:02:21 -050036ENV ODL_BOOT_FEATURES_EXTRA ${odl.boot.features.extra}
Timoney, Dan (dt5972)be94cc12018-07-02 18:02:35 -040037
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040038# Install sudo and IP utilities
Matej Klottonc6f21be2019-06-28 17:33:36 +020039RUN apk update && apk --no-cache add sudo iputils openssl
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040040
Timoney, Dan (dt5972)53cb6872019-07-30 12:13:33 -040041
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040042# Enable wheel group
43RUN sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers
44
Timoney, Dan (dt5972)53cb6872019-07-30 12:13:33 -040045# Create odl user
46RUN addgroup -S odl && adduser -S odl -G odl
47RUN addgroup odl wheel
48
Matej Klottonc6f21be2019-06-28 17:33:36 +020049COPY --from=stage0 --chown=odl:odl /opt /opt
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040050
Matej Klottonc6f21be2019-06-28 17:33:36 +020051# Add CCSDK repositories to boot repositories
52RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig
RehanRaza600b9442020-08-24 15:43:29 +020053RUN sed -i -e "\|featuresRepositories|s|$|, ${CCSDK_SLI_CORE_REPO}, ${CCSDK_SLI_ADAPTORS_REPO}, ${CCSDK_SLI_NORTHBOUND_REPO}, ${CCSDK_SLI_PLUGINS_REPO}, ${CCSDK_FEATURES_REPO}, ${A1ADAPTER_NORTHBOUND_REPO}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
Matej Klottonc6f21be2019-06-28 17:33:36 +020054RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,${ODL_BOOT_FEATURES_EXTRA}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
Marcus G K Williamsdc299ed2017-09-14 15:15:45 -070055
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050056USER odl
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040057ENTRYPOINT /opt/onap/ccsdk/bin/startODL.sh
Dan Timoney471dafa2017-08-21 14:44:05 -040058EXPOSE 8181