OCI image spec labels for drools-apps
[policy/drools-applications.git] / controlloop / packages / docker-controlloop / src / main / docker / Dockerfile
1 #-------------------------------------------------------------------------------
2 # Dockerfile
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
5 #  Modifications Copyright (C) 2022 Nordix Foundation.
6 # ================================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 # SPDX-License-Identifier: Apache-2.0
20 # ============LICENSE_END=========================================================
21 #-------------------------------------------------------------------------------
22
23 FROM onap/policy-drools:@version.policy.drools-pdp@
24
25 LABEL maintainer="Policy Team"
26 LABEL org.opencontainers.image.title="Policy Drools Applications"
27 LABEL org.opencontainers.image.description="Policy Drools Applications image"
28 LABEL org.opencontainers.image.url="https://github.com/onap/policy-drools-applications"
29 LABEL org.opencontainers.image.vendor="ONAP Policy Team"
30 LABEL org.opencontainers.image.licenses="Apache-2.0"
31 LABEL org.opencontainers.image.created="${git.build.time}"
32 LABEL org.opencontainers.image.version="${git.build.version}"
33 LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
34
35 ARG BUILD_VERSION_APP_CL=${BUILD_VERSION_APP_CL}
36 ENV BUILD_VERSION_APP_CL=${BUILD_VERSION_APP_CL}
37
38 COPY --chown=policy:policy /maven/apps-controlloop.zip $POLICY_INSTALL/
39 COPY --chown=policy:policy /maven/pdpd-cl-entrypoint.sh $POLICY_HOME/bin/
40
41 RUN unzip apps-controlloop.zip && \
42     tar -C $POLICY_HOME -xvf basex-controlloop-$BUILD_VERSION_APP_CL.tar.gz --no-same-owner && \
43     chmod 700 $POLICY_HOME/bin/* && \
44     chmod 600 $POLICY_HOME/config/* && \
45     . $POLICY_HOME/etc/profile.d/env.sh && \
46     $POLICY_HOME/bin/features install controlloop-utils controlloop-trans controlloop-management && \
47     $POLICY_HOME/bin/features install controlloop-usecases && \
48     $POLICY_HOME/bin/features enable healthcheck distributed-locking lifecycle && \
49     $POLICY_HOME/bin/features enable controlloop-trans controlloop-management && \
50     $POLICY_HOME/bin/features enable controlloop-usecases && \
51     $POLICY_HOME/bin/deploy-artifact -l -d -s $POLICY_HOME/etc/m2/standalone-settings.xml \
52         -a $POLICY_HOME/features/controlloop-management/lib/feature/feature-controlloop-management-$BUILD_VERSION_APP_CL.jar && \
53     $POLICY_HOME/bin/deploy-artifact -l -d -s $POLICY_HOME/etc/m2/standalone-settings.xml \
54         -a $POLICY_HOME/features/controlloop-usecases/artifacts/controller-usecases-$BUILD_VERSION_APP_CL.jar && \
55     find $HOME/.m2/ -name _maven.repositories -exec rm -v {} \; && \
56     find $HOME/.m2/ -name _remote.repositories -exec rm -v {} \; && \
57     rm $POLICY_INSTALL/apps-controlloop.zip $POLICY_INSTALL/basex-controlloop-$BUILD_VERSION_APP_CL.tar.gz 2> /dev/null
58
59 ENTRYPOINT ["/opt/app/policy/bin/pdpd-cl-entrypoint.sh"]
60 CMD ["boot"]