SDNC oam installer netconf clustering
[sdnc/oam.git] / installation / sdnc / src / main / docker / Dockerfile
old mode 100644 (file)
new mode 100755 (executable)
index 37db15d..d8ab5c3
@@ -1,29 +1,46 @@
 # Base ubuntu with added packages needed for open ecomp
-FROM openecomp/ubuntu-sdnc-image:${project.version}
+FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version}
 
-MAINTAINER SDN-C Team (sdnc@lists.openecomp.org)
+MAINTAINER SDN-C Team (sdnc@lists.onap.org)
 
-ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
-ENV ODL_HOME /opt/opendaylight/current
-ENV SDNC_CONFIG_DIR /opt/openecomp/sdnc/data/properties
+#ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
+ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
+ENV ODL_HOME /opt/opendaylight
+ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties
+ENV SDNC_STORE_DIR /opt/onap/sdnc/data/stores
+ENV SSL_CERTS_DIR /etc/ssl/certs
+ENV JAVA_SECURITY_DIR $SSL_CERTS_DIR/java
+ENV SDNC_NORTHBOUND_REPO mvn:org.onap.sdnc.northbound/sdnc-northbound-all/${sdnc.northbound.version}/xml/features
 
-# copy the opendaylight tar and expand
-COPY distribution-karaf-${sdnc.opendaylight.version}.tar.gz /tmp/
-RUN mkdir /opt/opendaylight \
-    && tar zxvf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz --directory /opt/opendaylight \
-    && rm -rf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz \
-    && ln -s /opt/opendaylight/distribution-karaf-${sdnc.opendaylight.version} /opt/opendaylight/current \
-    && mkdir /opt/openecomp
 
-COPY idmlight.db.mv.db /opt/opendaylight/current
+USER root
 
-# copy openecomp
+
+# imstall ssl and java certificates
+COPY AAF_RootCA.cer $SSL_CERTS_DIR
+COPY truststoreONAPall.jks $JAVA_SECURITY_DIR
+COPY AAF_RootCA.cer $SDNC_STORE_DIR
+COPY truststoreONAPall.jks $SDNC_STORE_DIR
+
+RUN keytool -importkeystore -srckeystore $JAVA_SECURITY_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts  -deststorepass changeit
+
+# copy onap
 COPY opt /opt
-RUN ln -s /opt/openecomp/sdnc /opt/sdnc
+RUN test -L /opt/sdnc || ln -s /opt/onap/sdnc /opt/sdnc
+RUN mkdir /opt/opendaylight/current/certs
+
+# copy SDNC mvn artifacts to ODL repository
+COPY system /tmp/system
+RUN rsync -a /tmp/system $ODL_HOME && rm -rf /tmp/system
+
+# Add SDNC repositories to boot repositories
+RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig
+RUN sed -i -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|"  $ODL_HOME/etc/org.apache.karaf.features.cfg
+RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-northbound-all|"  $ODL_HOME/etc/org.apache.karaf.features.cfg
+RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g"  $ODL_HOME/etc/org.apache.karaf.features.cfg
 
-# workaround till we get proxy working
-RUN mkdir -p /opt/opendaylight/current/system/mysql/mysql-connector-java/${sdnc.mysql-connector-java.version}
-COPY mysql-connector-java-${sdnc.mysql-connector-java.version}.jar /opt/opendaylight/current/system/mysql/mysql-connector-java/${sdnc.mysql-connector-java.version}
+RUN chown -R odl /opt
+USER odl
 
-# ENTRYPOINT exec /opt/opendaylight/current/bin/karaf
+ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh
 EXPOSE 8181