e80187a250f6fc4925ab074bdf47650aef45f74b
[nonrtric.git] / sdnc-a1-controller / oam / installation / sdnc-a1 / src / main / docker / standalone.Dockerfile
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
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
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=================================================
16 #
17
18 # Prepare stage for multistage image build
19 ## START OF STAGE0 ##
20 FROM nexus3.onap.org:10001/onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} AS stage0
21
22 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
23 ENV ODL_HOME /opt/opendaylight
24
25 USER root
26
27 # copy onap
28 COPY opt /opt
29 RUN test -L /opt/sdnc || ln -s /opt/onap/sdnc /opt/sdnc
30 RUN mkdir $ODL_HOME/current/certs
31
32 # copy SDNC mvn artifacts to ODL repository
33 COPY system /tmp/system
34 RUN rsync -a /tmp/system $ODL_HOME
35 ## END OF STAGE0 ##
36
37
38 FROM nexus3.onap.org:10001/onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version}
39
40 MAINTAINER O-RAN-SC NONRTRIC Team
41
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_TRUSTSTORE truststore.jks
49 ENV SDNC_SECUREPORT 8443
50
51 USER root
52
53 COPY --from=stage0 --chown=odl:odl /opt /opt
54
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
60
61 # Install java certificate
62 COPY $SDNC_KEYSTORE $JAVA_SECURITY_DIR
63 COPY $SDNC_TRUSTSTORE $JAVA_SECURITY_DIR
64
65 # Secure with TLS
66 RUN echo org.osgi.service.http.secure.enabled=true >> $ODL_HOME/etc/custom.properties
67 RUN echo org.osgi.service.http.secure.port=$SDNC_SECUREPORT >> $ODL_HOME/etc/custom.properties
68
69 RUN chown -R odl:odl /opt
70
71 USER odl
72
73 ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh
74 EXPOSE 8181 $SDNC_SECUREPORT