Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # ============LICENSE_START======================================================= |
danielhanrahan | 023b63a | 2022-06-01 17:34:54 +0100 | [diff] [blame] | 3 | # Copyright (C) 2022 Nordix Foundation. |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 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 | # |
danielhanrahan | 023b63a | 2022-06-01 17:34:54 +0100 | [diff] [blame] | 22 | # Docker file to build an image that runs the CLAMP ACM runtime on Java 11 or better in OpenSuse |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 23 | # |
danielhanrahan | d0db79a | 2022-07-11 15:15:40 +0100 | [diff] [blame^] | 24 | FROM opensuse/leap:15.4 |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 25 | |
| 26 | LABEL maintainer="Policy Team" |
danielhanrahan | 54c12dd | 2022-06-28 16:55:46 +0100 | [diff] [blame] | 27 | LABEL org.opencontainers.image.title="Policy CLAMP ACM runtime" |
| 28 | LABEL org.opencontainers.image.description="Policy CLAMP ACM runtime image based on OpenSuse" |
| 29 | LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp" |
| 30 | LABEL org.opencontainers.image.vendor="ONAP Policy Team" |
| 31 | LABEL org.opencontainers.image.licenses="Apache-2.0" |
| 32 | LABEL org.opencontainers.image.created="${git.build.time}" |
| 33 | LABEL org.opencontainers.image.version="${git.build.version}" |
| 34 | LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}" |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 35 | |
rameshiyer27 | 6131802 | 2022-07-05 23:08:44 +0100 | [diff] [blame] | 36 | ARG POLICY_LOGS=/var/log/onap/policy/policy-clamp-runtime-acm |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 37 | |
| 38 | ENV POLICY_LOGS=$POLICY_LOGS |
danielhanrahan | 023b63a | 2022-06-01 17:34:54 +0100 | [diff] [blame] | 39 | ENV POLICY_HOME=/opt/app/policy/clamp |
| 40 | ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 |
| 41 | ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11 |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 42 | |
danielhanrahan | 023b63a | 2022-06-01 17:34:54 +0100 | [diff] [blame] | 43 | RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar && \ |
| 44 | zypper -n -q update && zypper -n -q clean --all && \ |
| 45 | groupadd --system policy && \ |
| 46 | useradd --system --shell /bin/sh -G policy policy && \ |
| 47 | mkdir -p /app $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ |
| 48 | chown -R policy:policy /app $POLICY_HOME $POLICY_LOGS && \ |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 49 | mkdir /packages |
danielhanrahan | 023b63a | 2022-06-01 17:34:54 +0100 | [diff] [blame] | 50 | |
liamfallon | 4309804 | 2022-01-25 19:55:43 +0000 | [diff] [blame] | 51 | COPY /maven/lib/policy-clamp-runtime-acm.tar.gz /packages |
FrancescoFioraEst | 252a4bb | 2021-07-23 15:53:46 +0100 | [diff] [blame] | 52 | |
liamfallon | 4309804 | 2022-01-25 19:55:43 +0000 | [diff] [blame] | 53 | RUN tar xvfz /packages/policy-clamp-runtime-acm.tar.gz --directory $POLICY_HOME && \ |
| 54 | rm /packages/policy-clamp-runtime-acm.tar.gz |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 55 | |
| 56 | WORKDIR $POLICY_HOME |
liamfallon | 4309804 | 2022-01-25 19:55:43 +0000 | [diff] [blame] | 57 | COPY acm-runtime.sh bin/. |
liamfallon | 8040c95 | 2022-05-31 11:22:10 +0100 | [diff] [blame] | 58 | COPY /maven/policy-clamp-runtime-acm.jar /app/app.jar |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 59 | |
FrancescoFioraEst | 252a4bb | 2021-07-23 15:53:46 +0100 | [diff] [blame] | 60 | RUN chown -R policy:policy * && \ |
| 61 | chmod 755 bin/*.sh && \ |
| 62 | chown -R policy:policy /app |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 63 | |
rameshiyer27 | 3d8fc9a | 2021-11-05 14:24:02 +0000 | [diff] [blame] | 64 | EXPOSE 6969 |
| 65 | |
Sirisha_Manchikanti | 18526e9 | 2021-06-01 16:48:25 +0100 | [diff] [blame] | 66 | USER policy |
| 67 | WORKDIR $POLICY_HOME/bin |
liamfallon | 4309804 | 2022-01-25 19:55:43 +0000 | [diff] [blame] | 68 | ENTRYPOINT [ "./acm-runtime.sh" ] |