fix odl patches
[ccsdk/distribution.git] / opendaylight / chlorine / chlorine-alpine / src / main / docker / Dockerfile
1 # Prepare stage for multistage image build
2 ## START OF STAGE0 ##
3 FROM onap/ccsdk-alpine-j17-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 # Changing ownership and permission of /opt
32 RUN chown -R odl:odl /opt && chmod -R 755 /opt
33
34 ## END OF STAGE0 ##
35
36 #################################################
37
38 ## This will create actual image
39 FROM scratch
40 MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
41 USER root
42
43 ENV JAVA_HOME=/opt/java/openjdk \
44     PATH=$PATH:/opt/java/openjdk/bin \
45     ODL_HOME=/opt/opendaylight/current
46
47 # Copy Everything from stage0
48 COPY --from=stage0 / /
49
50 USER odl
51 EXPOSE 8181
52 WORKDIR $ODL_HOME
53 # ENTRYPOINT exec /opt/opendaylight/bin/karaf