1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2019 Tieto. All rights reserved.
3 # Modifications Copyright (C) 2020, 2021 AT&T Intellectual Property. All rights reserved.
4 # Modifications Copyright (C) 2020, 2022-2025 OpenInfra Foundation Europe. 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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
23 LABEL maintainer="Policy Team"
24 LABEL org.opencontainers.image.title="Policy JRE Alpine"
25 LABEL org.opencontainers.image.description="Policy Java 17 JRE image based on Alpine"
26 LABEL org.opencontainers.image.url="https://github.com/onap/policy-docker"
27 LABEL org.opencontainers.image.vendor="ONAP Policy Team"
28 LABEL org.opencontainers.image.licenses="Apache-2.0"
29 LABEL org.opencontainers.image.created="${git.build.time}"
30 LABEL org.opencontainers.image.version="${git.build.version}"
31 LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
33 ENV JAVA_HOME /usr/lib/jvm/default-jvm
34 ENV JAVA_OPTS="-Xms256m -Xmx1g"
36 ENV PYTHONUNBUFFERED=1
37 ENV POLICY_HOME=/opt/app/policy
38 ENV PATH $JAVA_HOME/bin:$PATH
43 # Default to UTF-8 file.encoding
44 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
52 rm -rf /var/cache/apk/* && \
54 addgroup -S $group && \
55 adduser -G $group -D $user && \
56 mkdir /var/log/$user && \
58 chown -R $user:$group /var/log/$user && \
59 chown -R $user:$group /app && \
60 # Policy Framework additions
69 rm -rf /var/cache/apk/* && \
70 addgroup -S policy && \
71 adduser -S --shell /bin/sh -G policy policy && \
72 mkdir -p ${POLICY_HOME}/ && \
73 chown policy:policy ${POLICY_HOME} && \
74 mkdir -p /usr/lib/jvm/ && ln -s /opt/java/openjdk /usr/lib/jvm/default-jvm
76 # Tell docker that all future commands should be run as the onap user