danielhanrahan | 9d74483 | 2022-06-01 14:26:24 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Dockerfile |
| 3 | # ============LICENSE_START======================================================= |
| 4 | # Copyright (C) 2022 Nordix Foundation. |
| 5 | # ================================================================================ |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ============LICENSE_END========================================================= |
| 20 | #------------------------------------------------------------------------------- |
| 21 | |
| 22 | FROM opensuse/leap:15.3 |
| 23 | |
| 24 | LABEL maintainer="Policy Team" |
| 25 | |
| 26 | ARG POLICY_LOGS=/var/log/onap/policy/distribution |
| 27 | |
| 28 | ENV POLICY_LOGS=$POLICY_LOGS |
| 29 | ENV POLICY_HOME=/opt/app/policy/distribution |
| 30 | ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 |
| 31 | ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11 |
| 32 | |
| 33 | RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar && \ |
| 34 | zypper -n -q update && zypper -n -q clean --all && \ |
| 35 | groupadd --system policy && \ |
| 36 | useradd --system --shell /bin/sh -G policy policy && \ |
| 37 | mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ |
| 38 | chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \ |
| 39 | mkdir /packages |
| 40 | |
| 41 | COPY /maven/* /packages |
| 42 | RUN tar xvfz /packages/policy-distribution.tar.gz --directory $POLICY_HOME \ |
| 43 | && rm /packages/policy-distribution.tar.gz |
| 44 | |
| 45 | WORKDIR $POLICY_HOME |
| 46 | COPY policy-dist.sh bin/. |
| 47 | RUN chown -R policy:policy * && chmod 755 bin/*.sh |
| 48 | |
| 49 | USER policy |
| 50 | WORKDIR $POLICY_HOME/bin |
| 51 | ENTRYPOINT [ "./policy-dist.sh" ] |