blob: 70d6b05224c2cc54b2cade4d1d264a8b06e87954 [file] [log] [blame]
Taka Cho2c618aa2020-09-04 08:49:10 -04001#-------------------------------------------------------------------------------
2# Dockerfile
3# ============LICENSE_START=======================================================
Pamela Dragoshdbbae8b2021-02-23 11:00:15 -05004# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
Rashmi Pujar5f919672022-02-04 21:49:30 -05005# Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
liamfallonae7225a2023-02-14 11:24:53 +00006# Modifications Copyright (C) 2022-2023 Nordix Foundation.
Taka Cho2c618aa2020-09-04 08:49:10 -04007# ================================================================================
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#-------------------------------------------------------------------------------
danielhanrahana5dd0e02022-06-29 13:51:39 +010023
24FROM busybox AS tarball
25RUN mkdir /packages /extracted
26COPY /maven/lib/policy-api.tar.gz /packages/
27RUN tar xvzf /packages/policy-api.tar.gz --directory /extracted/
28
saul.gill6388f212023-12-11 16:19:30 +000029FROM onap/policy-jre-alpine:3.1.1-SNAPSHOT
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050030
Dmitry Puzikova0745a72019-03-25 15:00:06 +010031LABEL maintainer="Policy Team"
danielhanrahan4be03952022-06-27 16:23:29 +010032LABEL org.opencontainers.image.title="Policy API"
33LABEL org.opencontainers.image.description="Policy API image based on Alpine"
34LABEL org.opencontainers.image.url="https://github.com/onap/policy-api"
35LABEL org.opencontainers.image.vendor="ONAP Policy Team"
36LABEL org.opencontainers.image.licenses="Apache-2.0"
37LABEL org.opencontainers.image.created="${git.build.time}"
38LABEL org.opencontainers.image.version="${git.build.version}"
39LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
Dmitry Puzikova0745a72019-03-25 15:00:06 +010040
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050041ARG POLICY_LOGS=/var/log/onap/policy/api
42
shaoqiud0fe0492019-06-25 06:10:52 +000043ENV POLICY_LOGS=$POLICY_LOGS
44ENV POLICY_HOME=$POLICY_HOME/api
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050045
liamfallonae7225a2023-02-14 11:24:53 +000046USER root
danielhanrahana5dd0e02022-06-29 13:51:39 +010047RUN mkdir -p $POLICY_HOME $POLICY_LOGS && \
48 chown -R policy:policy $POLICY_HOME $POLICY_LOGS
49
50COPY --chown=policy:policy --from=tarball /extracted/ $POLICY_HOME/
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050051
shaoqiud0fe0492019-06-25 06:10:52 +000052WORKDIR $POLICY_HOME
danielhanrahana5dd0e02022-06-29 13:51:39 +010053COPY --chown=policy:policy policy-api.sh bin/
54COPY --chown=policy:policy /maven/api.jar /app/
shaoqiud0fe0492019-06-25 06:10:52 +000055
danielhanrahana5dd0e02022-06-29 13:51:39 +010056RUN chmod 755 bin/*.sh
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050057
58USER policy
shaoqiud0fe0492019-06-25 06:10:52 +000059WORKDIR $POLICY_HOME/bin
danielhanrahan4be03952022-06-27 16:23:29 +010060ENTRYPOINT [ "./policy-api.sh" ]