blob: 14f10dd6fc1c2c0fc963b3145c538c00b74a5b6e [file] [log] [blame]
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +01001#-------------------------------------------------------------------------------
2# ============LICENSE_START=======================================================
3# Copyright (C) 2021 Nordix Foundation.
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19#-------------------------------------------------------------------------------
20
21#
22# Docker file to build an image that runs CLAMP on Java 11 or better in alpine
23#
liamfallon1beed572021-10-13 15:31:05 +010024FROM onap/policy-jre-alpine:2.3.1
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010025
26LABEL maintainer="Policy Team"
27
28ARG POLICY_LOGS=/var/log/onap/policy/clamp
29
30ENV POLICY_LOGS=$POLICY_LOGS
31ENV POLICY_HOME=$POLICY_HOME/clamp
32
33RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \
34 chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \
35 mkdir /packages
36COPY /maven/lib/policy-participant.tar.gz /packages
FrancescoFioraEst252a4bb2021-07-23 15:53:46 +010037
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010038RUN tar xvfz /packages/policy-participant.tar.gz --directory $POLICY_HOME && \
FrancescoFioraEst252a4bb2021-07-23 15:53:46 +010039 rm /packages/policy-participant.tar.gz
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010040
41WORKDIR $POLICY_HOME
42COPY policy-participant.sh bin/.
43COPY /maven/app.jar /app
44
FrancescoFioraEst252a4bb2021-07-23 15:53:46 +010045RUN chown -R policy:policy * && \
46 chmod 755 bin/*.sh && \
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010047 chown -R policy:policy /app
48
rameshiyer273d8fc9a2021-11-05 14:24:02 +000049EXPOSE 8085
50
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010051USER policy
52WORKDIR $POLICY_HOME/bin
53ENTRYPOINT [ "./policy-participant.sh" ]