1 #-------------------------------------------------------------------------------
3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
5 # Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
6 # Modifications Copyright (C) 2022 Nordix Foundation.
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
12 # http://www.apache.org/licenses/LICENSE-2.0
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.
20 # SPDX-License-Identifier: Apache-2.0
21 # ============LICENSE_END=========================================================
22 #-------------------------------------------------------------------------------
24 FROM busybox AS tarball
25 RUN mkdir /packages /extracted
26 COPY /maven/lib/policy-pap.tar.gz /packages/
27 RUN tar xvzf /packages/policy-pap.tar.gz --directory /extracted/
29 FROM onap/policy-jre-alpine:2.5.2-SNAPSHOT
31 LABEL maintainer="Policy Team"
32 LABEL org.opencontainers.image.title="Policy PAP"
33 LABEL org.opencontainers.image.description="Policy PAP image based on Alpine"
34 LABEL org.opencontainers.image.url="https://github.com/onap/policy-pap"
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}"
41 ARG POLICY_LOGS=/var/log/onap/policy/pap
43 ENV POLICY_LOGS=$POLICY_LOGS
44 ENV POLICY_HOME=$POLICY_HOME/pap
46 RUN mkdir -p $POLICY_HOME $POLICY_LOGS && \
47 chown -R policy:policy $POLICY_HOME $POLICY_LOGS
49 COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
52 COPY --chown=policy:policy policy-pap.sh bin/
53 COPY --chown=policy:policy /maven/pap.jar /app/
55 RUN chmod 755 bin/*.sh
58 WORKDIR $POLICY_HOME/bin
59 ENTRYPOINT [ "./policy-pap.sh" ]