blob: 5fd78664704d3fcea96ce87bbe1558c82d9cd1a2 [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 Timoney23b00b32020-09-04 13:02:08 -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
Lasse Kaihlavirta110bb112020-12-15 12:00:06 +020020LABEL maintainer="CCSDK Team (onap-ccsdk@lists.onap.org)"
Dan Timoney23b00b32020-09-04 13:02:08 -040021USER root
Matej Klottonc6f21be2019-06-28 17:33:36 +020022
Timoney, Dan (dt5972)21821db2018-03-13 19:26:40 -040023ENV SDNC_CONFIG_DIR /opt/onap/ccsdk/data/properties
highstreetherbertcc6dcf62020-08-21 13:57:10 +020024ENV CCSDKFEATUREVERSION ${ccsdk.features.version}
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040025ENV CCSDK_SLI_CORE_REPO mvn:org.onap.ccsdk.sli.core/ccsdk-sli-core-all/${ccsdk.sli.core.version}/xml/features
26ENV 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 -040027ENV CCSDK_FEATURES_REPO mvn:org.onap.ccsdk.features/ccsdk-features-all/${ccsdk.features.version}/xml/features
Herbert Eiselt4b054f92019-03-26 20:40:49 +010028ENV CCSDK_FEATURES_SDNR_WT_REPO mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator/${ccsdk.features.version}/xml/features
Dan Timoney1f4e9032021-01-25 14:47:00 -050029ENV CCSDK_FEATURES_SDNR_NORTHBOUND_REPO mvn:org.onap.ccsdk.features.sdnr.northbound/sdnr-northbound-all/${ccsdk.features.version}/xml/features
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040030ENV CCSDK_SLI_NORTHBOUND_REPO mvn:org.onap.ccsdk.sli.northbound/ccsdk-sli-northbound-all/${ccsdk.sli.northbound.version}/xml/features
31ENV 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 +020032ENV 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 -040033ENV ANSIBLE_GPG_KEY ${ansible.gpg.key}
Timoney, Dan (dt5972)aa9d8252019-02-04 18:02:21 -050034ENV ODL_BOOT_FEATURES_EXTRA ${odl.boot.features.extra}
Timoney, Dan (dt5972)be94cc12018-07-02 18:02:35 -040035
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040036# Install sudo and IP utilities
Matej Klottonc6f21be2019-06-28 17:33:36 +020037RUN apk update && apk --no-cache add sudo iputils openssl
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040038
Timoney, Dan (dt5972)53cb6872019-07-30 12:13:33 -040039
Dan Timoney1f4e9032021-01-25 14:47:00 -050040
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040041# Enable wheel group
42RUN sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers
43
Timoney, Dan (dt5972)53cb6872019-07-30 12:13:33 -040044# Create odl user
45RUN addgroup -S odl && adduser -S odl -G odl
46RUN addgroup odl wheel
47
Matej Klottonc6f21be2019-06-28 17:33:36 +020048COPY --from=stage0 --chown=odl:odl /opt /opt
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040049
Matej Klottonc6f21be2019-06-28 17:33:36 +020050# 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
Dan Timoney1f4e9032021-01-25 14:47:00 -050052RUN 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}, ${CCSDK_FEATURES_SDNR_NORTHBOUND_REPO} |" $ODL_HOME/etc/org.apache.karaf.features.cfg
Matej Klottonc6f21be2019-06-28 17:33:36 +020053RUN 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 -070054
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050055USER odl
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040056ENTRYPOINT /opt/onap/ccsdk/bin/startODL.sh