blob: 5ed566895f85773da6d116d62ec262e78ac0635d [file] [log] [blame]
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +01001#-------------------------------------------------------------------------------
2# ============LICENSE_START=======================================================
danielhanrahan023b63a2022-06-01 17:34:54 +01003# Copyright (C) 2022 Nordix Foundation.
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +01004# ================================================================================
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#
danielhanrahan023b63a2022-06-01 17:34:54 +010022# Docker file to build an image that runs the CLAMP ACM runtime on Java 11 or better in OpenSuse
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010023#
danielhanrahan023b63a2022-06-01 17:34:54 +010024FROM opensuse/leap:15.3
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
danielhanrahan023b63a2022-06-01 17:34:54 +010031ENV POLICY_HOME=/opt/app/policy/clamp
32ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
33ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010034
danielhanrahan023b63a2022-06-01 17:34:54 +010035RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar && \
36 zypper -n -q update && zypper -n -q clean --all && \
37 groupadd --system policy && \
38 useradd --system --shell /bin/sh -G policy policy && \
39 mkdir -p /app $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \
40 chown -R policy:policy /app $POLICY_HOME $POLICY_LOGS && \
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010041 mkdir /packages
danielhanrahan023b63a2022-06-01 17:34:54 +010042
liamfallon43098042022-01-25 19:55:43 +000043COPY /maven/lib/policy-clamp-runtime-acm.tar.gz /packages
FrancescoFioraEst252a4bb2021-07-23 15:53:46 +010044
liamfallon43098042022-01-25 19:55:43 +000045RUN tar xvfz /packages/policy-clamp-runtime-acm.tar.gz --directory $POLICY_HOME && \
46 rm /packages/policy-clamp-runtime-acm.tar.gz
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010047
48WORKDIR $POLICY_HOME
liamfallon43098042022-01-25 19:55:43 +000049COPY acm-runtime.sh bin/.
liamfallon8040c952022-05-31 11:22:10 +010050COPY /maven/policy-clamp-runtime-acm.jar /app/app.jar
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010051
FrancescoFioraEst252a4bb2021-07-23 15:53:46 +010052RUN chown -R policy:policy * && \
53 chmod 755 bin/*.sh && \
54 chown -R policy:policy /app
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010055
rameshiyer273d8fc9a2021-11-05 14:24:02 +000056EXPOSE 6969
57
Sirisha_Manchikanti18526e92021-06-01 16:48:25 +010058USER policy
59WORKDIR $POLICY_HOME/bin
liamfallon43098042022-01-25 19:55:43 +000060ENTRYPOINT [ "./acm-runtime.sh" ]