liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # ============LICENSE_START======================================================= |
danielhanrahan | a7309ed | 2022-06-28 11:45:15 +0100 | [diff] [blame] | 3 | # Copyright (C) 2020-2022 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 | |
danielhanrahan | c0f36b8 | 2022-07-01 15:11:06 +0100 | [diff] [blame] | 23 | FROM busybox AS tarball |
| 24 | RUN mkdir /packages /extracted |
| 25 | COPY /maven/apex-pdp-package-full.tar.gz /packages/ |
| 26 | RUN tar xvzf /packages/apex-pdp-package-full.tar.gz --directory /extracted/ |
| 27 | |
liamfallon | ab31342 | 2022-10-21 10:50:26 +0100 | [diff] [blame^] | 28 | FROM onap/policy-jdk-alpine:2.5.2-SNAPSHOT |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 29 | |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 30 | LABEL maintainer="Policy Team" |
danielhanrahan | a7309ed | 2022-06-28 11:45:15 +0100 | [diff] [blame] | 31 | LABEL org.opencontainers.image.title="Policy APEX PDP" |
| 32 | LABEL org.opencontainers.image.description="Policy APEX PDP image based on Alpine" |
| 33 | LABEL org.opencontainers.image.url="https://github.com/onap/policy-apex-pdp" |
| 34 | LABEL org.opencontainers.image.vendor="ONAP Policy Team" |
| 35 | LABEL org.opencontainers.image.licenses="Apache-2.0" |
| 36 | LABEL org.opencontainers.image.created="${git.build.time}" |
| 37 | LABEL org.opencontainers.image.version="${git.build.version}" |
| 38 | LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}" |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 39 | |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 40 | ARG POLICY_LOGS=/var/log/onap/policy/apex-pdp |
shaoqiu | ae257d1 | 2019-06-03 07:08:41 +0000 | [diff] [blame] | 41 | ENV POLICY_HOME=/opt/app/policy/apex-pdp |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 42 | ENV POLICY_LOGS=$POLICY_LOGS |
Dmitry Puzikov | 1aac864 | 2019-03-25 10:47:23 +0100 | [diff] [blame] | 43 | |
Jim Hahn | 6669d2b | 2021-08-25 11:44:58 -0400 | [diff] [blame] | 44 | RUN apk update \ |
| 45 | && apk add --no-cache \ |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 46 | vim \ |
liamfallon | 755eb9d | 2020-01-22 12:11:11 +0000 | [diff] [blame] | 47 | iputils \ |
| 48 | && addgroup -S apexuser && adduser -S apexuser -G apexuser \ |
danielhanrahan | c0f36b8 | 2022-07-01 15:11:06 +0100 | [diff] [blame] | 49 | && mkdir -p $POLICY_HOME $POLICY_LOGS \ |
| 50 | && chown -R apexuser:apexuser $POLICY_HOME $POLICY_LOGS |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 51 | |
danielhanrahan | c0f36b8 | 2022-07-01 15:11:06 +0100 | [diff] [blame] | 52 | COPY --chown=apexuser:apexuser --from=tarball /extracted $POLICY_HOME |
| 53 | RUN cp -pr $POLICY_HOME/examples /home/apexuser |
mmis | eed7a08 | 2018-07-17 00:30:34 +0100 | [diff] [blame] | 54 | |
| 55 | USER apexuser |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 56 | ENV PATH $POLICY_HOME/bin:$PATH |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 57 | WORKDIR /home/apexuser |
Ram Krishna Verma | 4d967d6 | 2021-03-23 13:03:52 -0400 | [diff] [blame] | 58 | ENTRYPOINT [ "/bin/sh" ] |