2 # ============LICENSE_START=======================================================
3 # Copyright (C) 2019 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
22 # Docker file to build an image that runs the PDP simulator on Java 8 in alpine
25 FROM onap/policy-common-alpine:1.4.0
27 LABEL maintainer="Policy Team"
29 ARG POLICY_LOGS=/var/log/onap/policy/pdp-sim
31 ENV POLICY_HOME=/opt/app/policy
32 ENV POLICY_LOGS=${POLICY_LOGS}
34 RUN apk add --no-cache --update \
51 # Create PDP simulator user and group
52 # Add simulator-specific directories and set ownership as the simulator user
53 RUN mkdir -p ${POLICY_HOME}/pdp-sim \
54 && mkdir -p ${POLICY_HOME}/pdp-sim/bin \
55 && mkdir -p ${POLICY_LOGS} \
56 && chown -R policy:policy ${POLICY_LOGS} \
60 COPY policy-models-sim-pdp-tarball.tar.gz /packages
61 RUN tar xvfz /packages/policy-models-sim-pdp-tarball.tar.gz --directory ${POLICY_HOME}/pdp-sim \
62 && rm /packages/policy-models-sim-pdp-tarball.tar.gz
64 # Ensure everything has the correct permissions
65 # Copy examples to PDP simulator user area
66 COPY pdp-sim.sh ${POLICY_HOME}/pdp-sim/bin
67 RUN find /opt/app -type d -perm 755 \
68 && find /opt/app -type f -perm 644 \
69 && chmod a+x ${POLICY_HOME}/pdp-sim/bin/*
72 ENV PATH ${POLICY_HOME}/pdp-sim/bin:$PATH
73 ENTRYPOINT [ "bash", "pdp-sim.sh" ]