Taka Cho | 2c618aa | 2020-09-04 08:49:10 -0400 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Dockerfile |
| 3 | # ============LICENSE_START======================================================= |
Pamela Dragosh | dbbae8b | 2021-02-23 11:00:15 -0500 | [diff] [blame] | 4 | # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. |
Rashmi Pujar | 5f91967 | 2022-02-04 21:49:30 -0500 | [diff] [blame] | 5 | # Modifications Copyright (C) 2022 Bell Canada. All rights reserved. |
liamfallon | ae7225a | 2023-02-14 11:24:53 +0000 | [diff] [blame] | 6 | # Modifications Copyright (C) 2022-2023 Nordix Foundation. |
Taka Cho | 2c618aa | 2020-09-04 08:49:10 -0400 | [diff] [blame] | 7 | # ================================================================================ |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | # you may not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
| 20 | # SPDX-License-Identifier: Apache-2.0 |
| 21 | # ============LICENSE_END========================================================= |
| 22 | #------------------------------------------------------------------------------- |
danielhanrahan | a5dd0e0 | 2022-06-29 13:51:39 +0100 | [diff] [blame] | 23 | |
| 24 | FROM busybox AS tarball |
| 25 | RUN mkdir /packages /extracted |
| 26 | COPY /maven/lib/policy-api.tar.gz /packages/ |
| 27 | RUN tar xvzf /packages/policy-api.tar.gz --directory /extracted/ |
| 28 | |
waynedunican | 4447ad9 | 2024-02-16 16:29:11 +0000 | [diff] [blame^] | 29 | FROM onap/policy-jre-alpine:3.1.1 |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 30 | |
Dmitry Puzikov | a0745a7 | 2019-03-25 15:00:06 +0100 | [diff] [blame] | 31 | LABEL maintainer="Policy Team" |
danielhanrahan | 4be0395 | 2022-06-27 16:23:29 +0100 | [diff] [blame] | 32 | LABEL org.opencontainers.image.title="Policy API" |
| 33 | LABEL org.opencontainers.image.description="Policy API image based on Alpine" |
| 34 | LABEL org.opencontainers.image.url="https://github.com/onap/policy-api" |
| 35 | LABEL org.opencontainers.image.vendor="ONAP Policy Team" |
| 36 | LABEL org.opencontainers.image.licenses="Apache-2.0" |
| 37 | LABEL org.opencontainers.image.created="${git.build.time}" |
| 38 | LABEL org.opencontainers.image.version="${git.build.version}" |
| 39 | LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}" |
Dmitry Puzikov | a0745a7 | 2019-03-25 15:00:06 +0100 | [diff] [blame] | 40 | |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 41 | ARG POLICY_LOGS=/var/log/onap/policy/api |
| 42 | |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 43 | ENV POLICY_LOGS=$POLICY_LOGS |
| 44 | ENV POLICY_HOME=$POLICY_HOME/api |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 45 | |
liamfallon | ae7225a | 2023-02-14 11:24:53 +0000 | [diff] [blame] | 46 | USER root |
danielhanrahan | a5dd0e0 | 2022-06-29 13:51:39 +0100 | [diff] [blame] | 47 | RUN mkdir -p $POLICY_HOME $POLICY_LOGS && \ |
| 48 | chown -R policy:policy $POLICY_HOME $POLICY_LOGS |
| 49 | |
| 50 | COPY --chown=policy:policy --from=tarball /extracted/ $POLICY_HOME/ |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 51 | |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 52 | WORKDIR $POLICY_HOME |
danielhanrahan | a5dd0e0 | 2022-06-29 13:51:39 +0100 | [diff] [blame] | 53 | COPY --chown=policy:policy policy-api.sh bin/ |
| 54 | COPY --chown=policy:policy /maven/api.jar /app/ |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 55 | |
danielhanrahan | a5dd0e0 | 2022-06-29 13:51:39 +0100 | [diff] [blame] | 56 | RUN chmod 755 bin/*.sh |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 57 | |
| 58 | USER policy |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 59 | WORKDIR $POLICY_HOME/bin |
danielhanrahan | 4be0395 | 2022-06-27 16:23:29 +0100 | [diff] [blame] | 60 | ENTRYPOINT [ "./policy-api.sh" ] |