point to 2.1.0 policy-alpine base - model-sim
[policy/models.git] / models-sim / policy-models-sim-pdp / src / main / package / docker / Dockerfile
1 #
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2019 Nordix Foundation.
4 #  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property.
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
22 FROM onap/policy-jre-alpine:2.1.0
23
24 LABEL maintainer="Policy Team"
25
26 ARG POLICY_LOGS=/var/log/onap/policy/pdp-sim
27
28 ENV POLICY_HOME=/opt/app/policy
29 ENV POLICY_LOGS=${POLICY_LOGS}
30
31 # Create PDP simulator user and group
32 # Add simulator-specific directories and set ownership as the simulator user
33 RUN mkdir -p ${POLICY_HOME}/pdp-sim \
34     && mkdir -p ${POLICY_HOME}/pdp-sim/bin \
35     && mkdir -p ${POLICY_LOGS} \
36     && chown -R policy:policy ${POLICY_LOGS} \
37     && mkdir /packages
38
39 # Unpack the tarball
40 COPY policy-models-sim-pdp-tarball.tar.gz /packages
41 RUN tar xvfz /packages/policy-models-sim-pdp-tarball.tar.gz --directory ${POLICY_HOME}/pdp-sim \
42     && rm /packages/policy-models-sim-pdp-tarball.tar.gz
43
44 # Ensure everything has the correct permissions
45 # Copy examples to PDP simulator user area
46 COPY pdp-sim.sh ${POLICY_HOME}/pdp-sim/bin
47 RUN find /opt/app -type d -perm 755 \
48     && find /opt/app -type f -perm 644 \
49     && chmod 755 ${POLICY_HOME}/pdp-sim/bin/*
50
51 USER policy
52 ENV PATH ${POLICY_HOME}/pdp-sim/bin:$PATH
53 ENTRYPOINT [ "bash", "pdp-sim.sh" ]