X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=installation%2Fsdnc%2Fsrc%2Fmain%2Fdocker%2FDockerfile;fp=installation%2Fsdnc%2Fsrc%2Fmain%2Fdocker%2FDockerfile;h=8b7e12b099798c73b5be309638deb2e80c3264fa;hb=33e9f85700d3ba17f95a69011d2d2932d4b98df0;hp=d4b3c64217d5e05814f082be3686a76c38804d35;hpb=7f64fd714a9f861f89a5f4bc2c3ef28c3b154b20;p=sdnc%2Foam.git diff --git a/installation/sdnc/src/main/docker/Dockerfile b/installation/sdnc/src/main/docker/Dockerfile index d4b3c642..8b7e12b0 100755 --- a/installation/sdnc/src/main/docker/Dockerfile +++ b/installation/sdnc/src/main/docker/Dockerfile @@ -1,9 +1,27 @@ -# Base ubuntu with added packages needed for open ecomp +# Prepare stage for multistage image build +## START OF STAGE0 ## +FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} AS stage0 + +ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk +ENV ODL_HOME /opt/opendaylight + +USER root + +# copy onap +COPY opt /opt +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 +## END OF STAGE0 ## + + FROM onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} MAINTAINER SDN-C Team (sdnc@lists.onap.org) -#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 @@ -19,14 +37,7 @@ ENV SDNC_SECUREPORT ${sdnc.secureport} USER root -# copy onap -COPY opt /opt -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 +COPY --from=stage0 --chown=odl:odl /opt /opt # 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 @@ -38,10 +49,9 @@ RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g" $ODL_HO COPY aaa-app-config.xml $ODL_HOME/etc/opendaylight/datastore/initial/config/ RUN echo "cadi_prop_files=$SDNC_CONFIG_DIR/org.onap.sdnc.props" >> $ODL_HOME/etc/system.properties -# install ssl and java certificates +# Install ssl and java certificates COPY truststoreONAPall.jks $JAVA_SECURITY_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 # Secure with TLS @@ -51,10 +61,8 @@ RUN echo org.ops4j.pax.web.ssl.keystore=$SDNC_STORE_DIR/$SDNC_KEYSTORE >> $ODL_H 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 +RUN chown -R odl:odl /opt - - -RUN chown -R odl /opt USER odl ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh