blob: 926aa0b560c046cc482003f0cf0d9287e19a5284 [file] [log] [blame]
Dan Timoney471dafa2017-08-21 14:44:05 -04001# Base ubuntu with added packages needed for open ecomp
Timoney, Dan (dt5972)268c4ba2019-02-12 14:35:10 -05002FROM ${base.image.name}:${project.docker.latestfulltag.version}
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -04003MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
Timoney, Dan (dt5972)b1ac7252018-12-14 13:00:43 -05004ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -04005ENV ODL_HOME /opt/opendaylight
Timoney, Dan (dt5972)21821db2018-03-13 19:26:40 -04006ENV SDNC_CONFIG_DIR /opt/onap/ccsdk/data/properties
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -04007ENV CCSDK_SLI_CORE_REPO mvn:org.onap.ccsdk.sli.core/ccsdk-sli-core-all/${ccsdk.sli.core.version}/xml/features
8ENV 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 -04009ENV CCSDK_FEATURES_REPO mvn:org.onap.ccsdk.features/ccsdk-features-all/${ccsdk.features.version}/xml/features
Herbert Eiselt4b054f92019-03-26 20:40:49 +010010ENV 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 -040011ENV CCSDK_SLI_NORTHBOUND_REPO mvn:org.onap.ccsdk.sli.northbound/ccsdk-sli-northbound-all/${ccsdk.sli.northbound.version}/xml/features
12ENV CCSDK_SLI_PLUGINS_REPO mvn:org.onap.ccsdk.sli.plugins/ccsdk-sli-plugins-all/${ccsdk.sli.plugins.version}/xml/features
Timoney, Dan (dt5972)a92a8382019-04-02 10:35:09 -070013
Timoney, Dan (dt5972)be94cc12018-07-02 18:02:35 -040014ENV ANSIBLE_GPG_KEY ${ansible.gpg.key}
Timoney, Dan (dt5972)aa9d8252019-02-04 18:02:21 -050015ENV ODL_BOOT_FEATURES_EXTRA ${odl.boot.features.extra}
Timoney, Dan (dt5972)be94cc12018-07-02 18:02:35 -040016
Dan Timoney74e4e8d2017-08-22 11:51:54 -040017# copy the opendaylight credentials
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040018COPY idmlight.db.mv.db $ODL_HOME/data
19
20
21# copy CCSDK mvn artifacts to ODL repository
22COPY system /tmp/system
23RUN rsync -a /tmp/system $ODL_HOME && rm -rf /tmp/system
24
25# Add CCSDK repositories to boot repositories
26RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig
Timoney, Dan (dt5972)34261272019-04-04 06:18:07 -070027
28RUN 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
Timoney, Dan (dt5972)aa9d8252019-02-04 18:02:21 -050029RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,${ODL_BOOT_FEATURES_EXTRA}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040030
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040031# Install sudo and IP utilities
32RUN apk update && apk add sudo iputils openssl
33
34# Enable wheel group
35RUN sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers
36
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040037# Create odl user
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050038RUN addgroup -S odl && adduser -S odl -G odl
Timoney, Dan (dt5972)ffa8f372019-05-07 10:40:24 -040039RUN addgroup odl wheel
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040040
Timoney, Dan (dt5972)be94cc12018-07-02 18:02:35 -040041# Install ansible
Timoney, Dan (dt5972)ea565422018-07-06 10:25:44 -040042#COPY ansible-sources.list /etc/apt/sources.list.d
43#RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv ${ANSIBLE_GPG_KEY} && \
44# gpg --export --armor ${ANSIBLE_GPG_KEY} | apt-key add - && \
Timoney, Dan (dt5972)b1ac7252018-12-14 13:00:43 -050045# apk update && \
46# apk add -y ansible
Alexis de Talhouët268c5e12018-09-12 15:27:33 -040047
48# Install ansible-opendaylight
Timoney, Dan (dt5972)ea565422018-07-06 10:25:44 -040049#RUN ansible-galaxy install git+https://git.opendaylight.org/gerrit/integration/packaging/ansible-opendaylight
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040050
51# Copy ccsdk install playbook
Timoney, Dan (dt5972)ea565422018-07-06 10:25:44 -040052#COPY install_ccsdk.yml /tmp
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040053
54# Install features in ODL
Timoney, Dan (dt5972)ea565422018-07-06 10:25:44 -040055#RUN ansible-playbook -i "localhost," -c local /tmp/install_ccsdk.yml
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040056
Dan Timoney471dafa2017-08-21 14:44:05 -040057
Dan Timoney74e4e8d2017-08-22 11:51:54 -040058# copy deliverables to opt
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050059COPY --chown=odl:odl opt /opt
60COPY --chown=odl:odl org.ops4j.pax.logging.cfg /opt/opendaylight/etc/org.ops4j.pax.logging.cfg
Dan Timoney471dafa2017-08-21 14:44:05 -040061
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050062RUN chown -R odl:odl /opt
Marcus G K Williamsdc299ed2017-09-14 15:15:45 -070063
Timoney, Dan (dt5972)38e175f2019-02-21 14:57:34 -050064USER odl
Timoney, Dan (dt5972)e14a0202018-06-22 17:05:16 -040065ENTRYPOINT /opt/onap/ccsdk/bin/startODL.sh
Dan Timoney471dafa2017-08-21 14:44:05 -040066EXPOSE 8181