2 # ============LICENSE_START=======================================================
4 # ================================================================================
5 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
6 # Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
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=========================================================
25 # Docker file to build an image that runs the simulators
28 FROM onap/policy-jre-alpine:2.3.1
30 LABEL maintainer="Policy Team"
32 ARG POLICY_LOGS=/var/log/onap/policy/simulators
34 ENV POLICY_HOME /opt/app/policy
35 ENV POLICY_LOGS ${POLICY_LOGS}
37 # Create DMaaP simulator user and group
38 # Add simulator-specific directories and set ownership as the simulator user
39 RUN mkdir -p ${POLICY_HOME}/simulators \
40 && mkdir -p ${POLICY_HOME}/simulators/bin \
41 && mkdir -p ${POLICY_LOGS} \
45 COPY /maven/* /packages
46 RUN tar xvfz /packages/models-simulator.tar.gz --directory ${POLICY_HOME}/simulators \
47 && rm /packages/models-simulator.tar.gz
49 # Ensure everything has the correct permissions
50 # Copy scripts simulator user area
51 COPY simulators.sh ${POLICY_HOME}/simulators/bin
52 RUN find /opt/app -type d -perm 755 \
53 && find /opt/app -type f -perm 644 \
54 && chmod 755 ${POLICY_HOME}/simulators/bin/* \
55 && chown -R policy:policy $POLICY_HOME $POLICY_LOGS
59 ENV PATH ${POLICY_HOME}/simulators/bin:$PATH
60 ENTRYPOINT [ "simulators.sh" ]