blob: 7bb3d23ac9fa8d9f07cf2d46ba2716ca071229c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# 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
ENV SDNC_KEYSTORE ${sdnc.keystore}
ENV SDNC_KEYPASS ${sdnc.keypass}
ENV SDNC_SECUREPORT ${sdnc.secureport}
ARG AAF=false
# Copy deliverables to opt
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
# Backing up existing karaf cfg and updating features boot and features repositories defined in pom.xml
RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.sdnc.orig
RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,${sdnc.features.boot}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
RUN sed -i -e "\|featuresRepositories|s|$|,${sdnr.features.repo},${sdnc.features.repo}|" $ODL_HOME/etc/org.apache.karaf.features.cfg
# Add odl-netconf-topology to boot repositories
RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g" $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
# Short term fix starts: for javax.servlet-api bundle (Replacing 4.0.1 to 3.1.0 as it's unique for javax.servlet-api)
RUN find /opt/opendaylight -name "*features*.xml" -exec sed -i -e 's|4.0.1|3.1.0|g' {} \;
# Short term fix ends
# 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 LC_ALL=en_US.UTF-8 \
JAVA_HOME=/opt/java/openjdk \
PATH=$PATH:/opt/java/openjdk/bin \
ODL_HOME=/opt/opendaylight/current \
SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties \
SDNC_KEYSTORE=${sdnc.keystore} \
SDNC_KEYPASS=${sdnc.keypass}
# Copy Everything from stage0
COPY --from=stage0 / /
USER odl
EXPOSE 8181
WORKDIR ${ODL_HOME}
ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh
|