1 # Prepare stage for multistage image build
3 FROM onap/ccsdk-alpine-j17-image:${project.docker.latestfulltag.version} AS stage0
6 ENV ODL_HOME /opt/opendaylight/current
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
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 \
20 && adduser -S odl -G odl \
23 # Patch some opendaylight artifacts
24 COPY system $ODL_HOME/system
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
31 # Changing ownership and permission of /opt
32 RUN chown -R odl:odl /opt && chmod -R 755 /opt
36 #################################################
38 ## This will create actual image
40 MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
43 ENV JAVA_HOME=/opt/java/openjdk \
44 PATH=$PATH:/opt/java/openjdk/bin \
45 ODL_HOME=/opt/opendaylight/current
47 # Copy Everything from stage0
48 COPY --from=stage0 / /
53 # ENTRYPOINT exec /opt/opendaylight/bin/karaf