X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=installation%2Fsdnc%2Fsrc%2Fmain%2Fdocker%2FDockerfile;h=65b908ce8108442ffe70556bb844637d18abce96;hb=55378e7480442b8cee46d215a85e194c56b38f36;hp=2e2140bc6d8a68fc4956f1f7a696034406304146;hpb=575be0db5aff2505026238d8e73b7d662efb070f;p=sdnc%2Foam.git diff --git a/installation/sdnc/src/main/docker/Dockerfile b/installation/sdnc/src/main/docker/Dockerfile old mode 100644 new mode 100755 index 2e2140bc..65b908ce --- a/installation/sdnc/src/main/docker/Dockerfile +++ b/installation/sdnc/src/main/docker/Dockerfile @@ -1,23 +1,86 @@ -# Base ubuntu with added packages needed for open ecomp -FROM ecomp/ubuntu-sdnc-image:${project.version} -MAINTAINER SDN-C Team (sdnc@lists.openecomp.org) -ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64 -ENV ODL_HOME /opt/opendaylight/current -ENV SDNC_CONFIG_DIR /opt/openecomp/sdnc/data/properties +# Prepare stage for multistage image build +## START OF STAGE0 ## +FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} AS stage0 +USER root + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $PATH:/opt/java/openjdk/bin + +ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties +ENV SDNC_STORE_DIR /opt/onap/sdnc/data/stores +ENV JAVA_SECURITY_DIR /etc/ssl/certs/java -# copy the opendaylight tar and expand -COPY distribution-karaf-0.4.2-Beryllium-SR2.tar.gz /tmp -RUN mkdir /opt/opendaylight /opt/openecomp -RUN tar zxvf /tmp/distribution-karaf-0.4.2-Beryllium-SR2.tar.gz --directory /opt/opendaylight -RUN ln -s /opt/opendaylight/distribution-karaf-0.4.2-Beryllium-SR2 /opt/opendaylight/current -COPY idmlight.db.mv.db /opt/opendaylight/current +ENV SDNC_KEYSTORE ${sdnc.keystore} +ENV SDNC_KEYPASS ${sdnc.keypass} +ENV SDNC_SECUREPORT ${sdnc.secureport} -# copy openecomp +ARG AAF=false + +# 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 $ODL_HOME/current/certs + +# Copy SDNC mvn artifacts to ODL repository +COPY system /tmp/system +RUN rsync -a /tmp/system $ODL_HOME + +# Add odl-netconf-topology 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 "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g" $ODL_HOME/etc/org.apache.karaf.features.cfg + +# Add SDNC repositories to boot repositories +ENV SDNC_NORTHBOUND_REPO mvn:org.onap.sdnc.northbound/sdnc-northbound-all/${sdnc.northbound.version}/xml/features +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 + + +# Add aaa-app-config.xml Only if AAF is set to true (being passed as an argument in docker-maven-plugin configuration) +COPY aaa-app-config.xml /tmp/aaa-app-config.xml +RUN if "${AAF}" ; then \ + mkdir -p $ODL_HOME/etc/opendaylight/datastore/initial/config ;\ + mv /tmp/aaa-app-config.xml $ODL_HOME/etc/opendaylight/datastore/initial/config/. ;\ + echo "cadi_prop_files=$SDNC_CONFIG_DIR/org.onap.sdnc.props" >> $ODL_HOME/etc/system.properties ;\ + fi + +# Install ssl and java certificates +COPY truststoreONAPall.jks $SDNC_STORE_DIR +RUN if [ -f $JAVA_SECURITY_DIR}/cacerts ] ; then keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts -deststorepass changeit -noprompt ; fi +RUN keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore /opt/java/openjdk/lib/security/cacerts -deststorepass changeit -noprompt + +# Secure with TLS +RUN echo org.osgi.service.http.secure.enabled=true >> $ODL_HOME/etc/custom.properties +RUN echo org.osgi.service.http.secure.port=$SDNC_SECUREPORT >> $ODL_HOME/etc/custom.properties +RUN echo org.ops4j.pax.web.ssl.keystore=$SDNC_STORE_DIR/$SDNC_KEYSTORE >> $ODL_HOME/etc/custom.properties +RUN echo org.ops4j.pax.web.ssl.password=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties +RUN echo org.ops4j.pax.web.ssl.keypassword=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties + +# Overwrite svclogic compiler properties +RUN cp /opt/onap/sdnc/data/properties/svclogic-compiler.properties /opt/onap/sdnc/svclogic/config/svclogic.properties + +# Changing ownership and permission of /opt +RUN chown -R odl:odl /opt && chmod -R 755 /opt + +## END OF STAGE0 ## + +################################################# + +## This will create actual image +FROM scratch +LABEL maintainer="SDN-C Team (sdnc@lists.onap.org)" +USER root + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $PATH:/opt/java/openjdk/bin + +ENV ODL_HOME /opt/opendaylight/current +ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties +ENV SDNC_KEYSTORE ${sdnc.keystore} +ENV SDNC_KEYPASS ${sdnc.keypass} + +# Copy Everything from stage0 +COPY --from=stage0 / / -# workaround till we get proxy working -COPY mysql.tgz /tmp -RUN tar zxvf /tmp/mysql.tgz --directory /opt/opendaylight/current/system -# ENTRYPOINT exec /opt/opendaylight/current/bin/karaf +USER odl +ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh EXPOSE 8181