liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2020 Nordix Foundation. |
Jim Hahn | 6669d2b | 2021-08-25 11:44:58 -0400 | [diff] [blame] | 4 | # Modification Copyright (C) 2020-2021 AT&T Foundation. |
a.sreekumar | 1f47753 | 2021-02-23 15:45:34 +0000 | [diff] [blame] | 5 | # Modifications Copyright (C) 2021 Bell Canada. |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 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 |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 10 | # |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 12 | # |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 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 | # |
| 24 | # Docker file to build an image that runs APEX on Java 11 or better in alpine |
| 25 | # |
liamfallon | 0ec3b50 | 2021-11-25 15:50:38 +0000 | [diff] [blame] | 26 | FROM onap/policy-jdk-alpine:2.4.0 |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 27 | |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 28 | LABEL maintainer="Policy Team" |
| 29 | |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 30 | ARG POLICY_LOGS=/var/log/onap/policy/apex-pdp |
shaoqiu | ae257d1 | 2019-06-03 07:08:41 +0000 | [diff] [blame] | 31 | ENV POLICY_HOME=/opt/app/policy/apex-pdp |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 32 | ENV POLICY_LOGS=$POLICY_LOGS |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 33 | |
Jim Hahn | 6669d2b | 2021-08-25 11:44:58 -0400 | [diff] [blame] | 34 | RUN apk update \ |
| 35 | && apk add --no-cache \ |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 36 | vim \ |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 37 | iputils \ |
| 38 | && addgroup -S apexuser && adduser -S apexuser -G apexuser \ |
| 39 | && mkdir -p $POLICY_HOME \ |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 40 | && mkdir -p $POLICY_LOGS \ |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 41 | && chown -R apexuser:apexuser $POLICY_LOGS \ |
| 42 | && mkdir /packages |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 43 | |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 44 | COPY /maven/apex-pdp-package-full.tar.gz /packages |
| 45 | RUN tar xvfz /packages/apex-pdp-package-full.tar.gz --directory $POLICY_HOME \ |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 46 | && rm /packages/apex-pdp-package-full.tar.gz \ |
| 47 | && find /opt/app -type d -perm 755 \ |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 48 | && find /opt/app -type f -perm 644 \ |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 49 | && chmod 755 $POLICY_HOME/bin/* \ |
| 50 | && cp -pr $POLICY_HOME/examples /home/apexuser \ |
a.sreekumar | 6fae58f | 2020-01-06 15:48:31 +0000 | [diff] [blame] | 51 | && chown -R apexuser:apexuser /home/apexuser/* $POLICY_HOME \ |
| 52 | && chmod 755 $POLICY_HOME/etc/* |
mmis | eed7a08 | 2018-07-17 00:30:34 +0100 | [diff] [blame] | 53 | |
| 54 | USER apexuser |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 55 | ENV PATH $POLICY_HOME/bin:$PATH |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 56 | WORKDIR /home/apexuser |
Ram Krishna Verma | 4d967d6 | 2021-03-23 13:03:52 -0400 | [diff] [blame] | 57 | ENTRYPOINT [ "/bin/sh" ] |