blob: cca71f6d2b754cba7bbabf807580053ffdb86245 [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
Matej Klottonc6f21be2019-06-28 17:33:36 +02005# copy the opendaylight credentials
Dan Timoney0b9839e2020-09-01 16:21:53 -04006USER ROOT
Matej Klottonc6f21be2019-06-28 17:33:36 +02007COPY idmlight.db.mv.db $ODL_HOME/data
8
9# copy CCSDK mvn artifacts to ODL repository
10COPY system /tmp/system
11RUN rsync -a /tmp/system $ODL_HOME
12
13# copy deliverables to opt
14COPY opt /opt
15COPY org.ops4j.pax.logging.cfg $ODL_HOME/etc/org.ops4j.pax.logging.cfg
16## END OF STAGE0 ##
17
Timoney, Dan (dt5972)268c4ba2019-02-12 14:35:10 -050018FROM ${base.image.name}:${project.docker.latestfulltag.version}
Matej Klottonc6f21be2019-06-28 17:33:36 +020019
Michael Dürre1a75e482020-09-01 13:04:25 +020020LABEL maintainer="CCSDK Team (onap-ccsdk@lists.onap.org)"
Matej Klottonc6f21be2019-06-28 17:33:36 +020021
Timoney, Dan (dt5972)21821db2018-03-13 19:26:40 -040022ENV SDNC_CONFIG_DIR /opt/onap/ccsdk/data/properties
highstreetherbertcc6dcf62020-08-21 13:57:10 +020023ENV CCSDKFEATUREVERSION ${ccsdk.features.version}
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040024ENV CCSDK_SLI_CORE_REPO mvn:org.onap.ccsdk.sli.core/ccsdk-sli-core-all/${ccsdk.sli.core.version}/xml/features
25ENV 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 -040026ENV CCSDK_FEATURES_REPO mvn:org.onap.ccsdk.features/ccsdk-features-all/${ccsdk.features.version}/xml/features
Herbert Eiselt4b054f92019-03-26 20:40:49 +010027ENV 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 -040028ENV CCSDK_SLI_NORTHBOUND_REPO mvn:org.onap.ccsdk.sli.northbound/ccsdk-sli-northbound-all/${ccsdk.sli.northbound.version}/xml/features
29ENV 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 +020030ENV 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 -040031ENV ANSIBLE_GPG_KEY ${ansible.gpg.key}
Timoney, Dan (dt5972)aa9d8252019-02-04 18:02:21 -050032ENV ODL_BOOT_FEATURES_EXTRA ${odl.boot.features.extra}
Timoney, Dan (dt5972)be94cc12018-07-02 18:02:35 -040033
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040034# Install sudo and IP utilities
Matej Klottonc6f21be2019-06-28 17:33:36 +020035RUN apk update && apk --no-cache add sudo iputils openssl
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040036
Timoney, Dan (dt5972)53cb6872019-07-30 12:13:33 -040037
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040038# Enable wheel group
39RUN sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers
40
Timoney, Dan (dt5972)53cb6872019-07-30 12:13:33 -040041# Create odl user
42RUN addgroup -S odl && adduser -S odl -G odl
43RUN addgroup odl wheel
44
Matej Klottonc6f21be2019-06-28 17:33:36 +020045COPY --from=stage0 --chown=odl:odl /opt /opt
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040046
Matej Klottonc6f21be2019-06-28 17:33:36 +020047# Add CCSDK repositories to boot repositories
48RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig
RehanRaza600b9442020-08-24 15:43:29 +020049RUN 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 +020050RUN 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 -070051
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050052USER odl
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040053ENTRYPOINT /opt/onap/ccsdk/bin/startODL.sh