1 # ============LICENSE_START===============================================
2 # Modifications Copyright (C) 2020 Nordix Foundation. All rights reserved.
3 # ========================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=================================================
18 # Prepare stage for multistage image build
20 FROM nexus3.onap.org:10001/onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} AS stage0
22 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
23 ENV ODL_HOME /opt/opendaylight
29 RUN test -L /opt/sdnc || ln -s /opt/onap/sdnc /opt/sdnc
30 RUN mkdir $ODL_HOME/current/certs
32 # copy SDNC mvn artifacts to ODL repository
33 COPY system /tmp/system
34 RUN rsync -a /tmp/system $ODL_HOME
38 FROM nexus3.onap.org:10001/onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version}
40 MAINTAINER O-RAN-SC NONRTRIC Team
42 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
43 ENV ODL_HOME /opt/opendaylight
44 ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties
45 ENV JAVA_SECURITY_DIR /etc/ssl/certs/java
46 ENV SDNC_NORTHBOUND_REPO mvn:org.o-ran-sc.nonrtric.sdnc-a1.northbound/sdnc-a1-northbound-all/${sdnc.northbound.version}/xml/features
47 ENV SDNC_KEYSTORE keystore.jks
48 ENV SDNC_KEYPASS sdnc-a1-controller
49 ENV SDNC_SECUREPORT 8443
53 COPY --from=stage0 --chown=odl:odl /opt /opt
55 # Add SDNC repositories to boot repositories
56 RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig
57 RUN sed -i -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
58 RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-a1-northbound-all|" $ODL_HOME/etc/org.apache.karaf.features.cfg
59 RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g" $ODL_HOME/etc/org.apache.karaf.features.cfg
61 # Install java certificate
62 COPY $SDNC_KEYSTORE $JAVA_SECURITY_DIR
65 RUN echo org.osgi.service.http.secure.enabled=true >> $ODL_HOME/etc/custom.properties
66 RUN echo org.osgi.service.http.secure.port=$SDNC_SECUREPORT >> $ODL_HOME/etc/custom.properties
67 RUN echo org.ops4j.pax.web.ssl.keystore=$JAVA_SECURITY_DIR/$SDNC_KEYSTORE >> $ODL_HOME/etc/custom.properties
68 RUN echo org.ops4j.pax.web.ssl.password=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties
69 RUN echo org.ops4j.pax.web.ssl.keypassword=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties
71 RUN chown -R odl:odl /opt
75 ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh
76 EXPOSE 8181 $SDNC_SECUREPORT