blob: 6b8ff757db3f2640b5f6df4108263a30eec5ecb5 [file] [log] [blame]
Taka Cho03613a82020-09-04 09:02:09 -04001#-------------------------------------------------------------------------------
2# Dockerfile
3# ============LICENSE_START=======================================================
4# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
5# ================================================================================
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
20#-------------------------------------------------------------------------------
21
Jim Hahn42e24692020-09-14 18:07:12 -040022FROM onap/policy-jre-alpine:2.1.1
mmis461cafd2018-09-05 10:35:44 +010023
Dmitry Puzikov39bac7e2019-03-25 15:16:04 +010024LABEL maintainer="Policy Team"
25
ramvermab5f49342019-02-05 15:34:35 +000026ARG POLICY_LOGS=/var/log/onap/policy/distribution
mmis461cafd2018-09-05 10:35:44 +010027
shaoqiu7c28dfd2019-06-26 04:08:11 +000028ENV POLICY_LOGS=$POLICY_LOGS
29ENV POLICY_HOME=$POLICY_HOME/distribution
mmis461cafd2018-09-05 10:35:44 +010030
shaoqiu7c28dfd2019-06-26 04:08:11 +000031RUN mkdir -p $POLICY_HOME $POLICY_LOGS $POLICY_HOME/bin && \
HOCKLAb8306062020-01-20 16:37:27 -060032 chown -R policy:policy $POLICY_HOME $POLICY_LOGS &&\
33 mkdir /packages
mmis461cafd2018-09-05 10:35:44 +010034
mmis461cafd2018-09-05 10:35:44 +010035COPY /maven/* /packages
shaoqiu7c28dfd2019-06-26 04:08:11 +000036RUN tar xvfz /packages/policy-distribution.tar.gz --directory $POLICY_HOME \
ning.xi11319a12019-03-06 03:32:53 +000037 && rm /packages/policy-distribution.tar.gz
mmis461cafd2018-09-05 10:35:44 +010038
shaoqiu7c28dfd2019-06-26 04:08:11 +000039WORKDIR $POLICY_HOME
mmis461cafd2018-09-05 10:35:44 +010040COPY policy-dist.sh bin/.
shaoqiu7c28dfd2019-06-26 04:08:11 +000041RUN chown -R policy:policy * && chmod 755 bin/*.sh
mmis461cafd2018-09-05 10:35:44 +010042
43USER policy
shaoqiu7c28dfd2019-06-26 04:08:11 +000044WORKDIR $POLICY_HOME/bin
mmis461cafd2018-09-05 10:35:44 +010045ENTRYPOINT [ "bash", "./policy-dist.sh" ]