blob: b4d204956d7e043804f6fd5232570e1c6c9ba664 [file] [log] [blame]
aravind.estdf28b0a2023-02-14 09:29:14 +00001#-------------------------------------------------------------------------------
2# ============LICENSE_START=======================================================
3# Copyright (C) 2023 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
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
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.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19#-------------------------------------------------------------------------------
20
21FROM busybox AS tarball
22RUN mkdir /packages /extracted
23COPY /maven/lib/kserve-participant.tar.gz /packages/
24RUN tar xvzf /packages/kserve-participant.tar.gz --directory /extracted/
25
26FROM opensuse/leap:15.4
27
28LABEL maintainer="Policy Team"
29LABEL org.opencontainers.image.title="Policy CLAMP ACM KSERVE Participant"
30LABEL org.opencontainers.image.description="Policy CLAMP ACM KSERVE Participant image based on OpenSuse"
31LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
32LABEL org.opencontainers.image.vendor="ONAP Policy Team"
33LABEL org.opencontainers.image.licenses="Apache-2.0"
34LABEL org.opencontainers.image.created="${git.build.time}"
35LABEL org.opencontainers.image.version="${git.build.version}"
36LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
37
38ARG POLICY_LOGS=/var/log/onap/policy/kserve-participant
39
40ENV POLICY_LOGS=$POLICY_LOGS
41ENV POLICY_HOME=/opt/app/policy/clamp
42ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
43ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
44
45RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar wget && \
46 zypper -n -q update && zypper -n -q clean --all && \
47 groupadd --system policy && \
48 useradd --system --shell /bin/sh -G policy policy && \
49 mkdir -p /app $POLICY_HOME $POLICY_LOGS && \
50 chown -R policy:policy /app $POLICY_HOME $POLICY_LOGS
51
52COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
53
54WORKDIR $POLICY_HOME
aravind.est89b62d52023-02-22 16:29:50 +000055COPY --chown=policy:policy kserve-participant.sh bin/
aravind.estdf28b0a2023-02-14 09:29:14 +000056COPY --chown=policy:policy /maven/policy-clamp-participant-impl-kserve.jar /app/app.jar
57
58RUN chmod 755 bin/*.sh
59
60EXPOSE 8087
61
62USER policy
63WORKDIR $POLICY_HOME/bin
64ENTRYPOINT [ "./kserve-participant.sh" ]
65
66