Fix: upgrade to robotframework py3 script
[ccsdk/distribution.git] / opendaylight / phosphorus / phosphorus-alpine / src / main / docker / Dockerfile
1 # Prepare stage for multistage image build
2 ## START OF STAGE0 ##
3 FROM onap/ccsdk-alpine-j11-image:${project.docker.latestfulltag.version} AS stage0
4 USER root
5
6 ENV ODL_HOME /opt/opendaylight/current
7
8 # copy the opendaylight tar and expand
9 COPY ${odl.karaf.artifactId}-${ccsdk.opendaylight.version}.tar.gz /tmp/
10 RUN mkdir -p /opt/odl \
11     && tar xzf /tmp/${odl.karaf.artifactId}-${ccsdk.opendaylight.version}.tar.gz --directory /opt/odl \
12     && rm -rf /tmp/${odl.karaf.artifactId}-${ccsdk.opendaylight.version}.tar.gz \
13     && mv /opt/odl/${odl.karaf.artifactId}-${ccsdk.opendaylight.version} /opt/opendaylight \
14     && ln -s  /opt/opendaylight /opt/opendaylight/${odl.karaf.artifactId}-${ccsdk.opendaylight.version} \
15     && ln -s /opt/opendaylight /opt/opendaylight/current
16
17 # Enable wheel and create a group and user
18 RUN sed -i -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers \
19     && addgroup -S odl \
20     && adduser -S odl -G odl \
21     && addgroup odl wheel
22
23 # Patch some opendaylight artifacts
24 COPY system $ODL_HOME/system
25
26 # Add missing scripts see SDNC-1056
27 #COPY configure_cluster.sh configure-cluster-ipdetect.sh custom_shard_config.txt set_persistence.sh $ODL_HOME/bin/
28 #RUN chmod 755 $ODL_HOME/bin/configure_cluster.sh $ODL_HOME/bin/configure-cluster-ipdetect.sh $ODL_HOME/bin/set_persistence.sh $ODL_HOME/bin/custom_shard_config.txt
29
30
31 # Remove vulnerable version of ops4j logging
32 COPY framework-${odl.karaf.framework.version}-features.xml $ODL_HOME/system/org/apache/karaf/features/framework/${odl.karaf.framework.version}/framework-${odl.karaf.framework.version}-features.xml
33 COPY startup.properties $ODL_HOME/etc/startup.properties
34 RUN rm -rf $ODL_HOME/system/org/ops4j/pax/logging/pax-logging-log4j2/${odl.pax.logging.version}
35 RUN rm -rf $ODL_HOME/system/org/ops4j/pax/logging/pax-logging-logback/${odl.pax.logging.version}
36 RUN rm -rf $ODL_HOME/system/org/ops4j/pax/logging/pax-logging-api/${odl.pax.logging.version}
37
38 # Changing ownership and permission of /opt
39 RUN chown -R odl:odl /opt && chmod -R 755 /opt
40
41 ## END OF STAGE0 ##
42
43 #################################################
44
45 ## This will create actual image
46 FROM scratch
47 MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
48 USER root
49
50 ENV JAVA_HOME=/opt/java/openjdk \
51     PATH=$PATH:/opt/java/openjdk/bin \
52     ODL_HOME=/opt/opendaylight/current
53
54 # Copy Everything from stage0
55 COPY --from=stage0 / /
56
57 USER odl
58 EXPOSE 8181
59 WORKDIR $ODL_HOME
60 # ENTRYPOINT exec /opt/opendaylight/bin/karaf