blob: 72250e8af7451f5a50bcd5ee1c0f8359b57f4c03 [file] [log] [blame]
rameshiyer279ab7dc72021-07-07 08:02:55 +01001#-------------------------------------------------------------------------------
2# ============LICENSE_START=======================================================
liamfallone72ff812023-02-14 11:34:52 +00003# Copyright (C) 2021-2023 Nordix Foundation.
rameshiyer279ab7dc72021-07-07 08:02:55 +01004# ================================================================================
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
danielhanrahancd213592022-07-11 18:14:13 +010021FROM busybox AS tarball
22RUN mkdir /packages /extracted
23COPY /maven/lib/kubernetes-participant.tar.gz /packages/
24RUN tar xvzf /packages/kubernetes-participant.tar.gz --directory /extracted/
25
liamfallon0b5e9962022-12-15 16:19:55 +000026FROM onap/policy-jre-alpine:2.6.1-SNAPSHOT
rameshiyer279ab7dc72021-07-07 08:02:55 +010027
28LABEL maintainer="Policy Team"
danielhanrahan54c12dd2022-06-28 16:55:46 +010029LABEL org.opencontainers.image.title="Policy CLAMP ACM K8S Participant"
30LABEL org.opencontainers.image.description="Policy CLAMP ACM K8S Participant image based on Alpine"
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}"
rameshiyer279ab7dc72021-07-07 08:02:55 +010037
rameshiyer2761318022022-07-05 23:08:44 +010038ARG POLICY_LOGS=/var/log/onap/policy/k8s-participant
rameshiyer279ab7dc72021-07-07 08:02:55 +010039
40ENV POLICY_LOGS=$POLICY_LOGS
41ENV POLICY_HOME=$POLICY_HOME/clamp
42
liamfallone72ff812023-02-14 11:34:52 +000043USER root
danielhanrahancd213592022-07-11 18:14:13 +010044RUN mkdir -p $POLICY_HOME $POLICY_LOGS && \
45 chown -R policy:policy $POLICY_HOME $POLICY_LOGS
rameshiyer279ab7dc72021-07-07 08:02:55 +010046
danielhanrahancd213592022-07-11 18:14:13 +010047COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
rameshiyer279ab7dc72021-07-07 08:02:55 +010048
49WORKDIR $POLICY_HOME
danielhanrahancd213592022-07-11 18:14:13 +010050COPY --chown=policy:policy kubernetes-participant.sh bin/
51COPY --chown=policy:policy /maven/policy-clamp-participant-impl-kubernetes.jar /app/app.jar
rameshiyer279ab7dc72021-07-07 08:02:55 +010052
danielhanrahancd213592022-07-11 18:14:13 +010053RUN chmod 755 bin/*.sh && \
rameshiyer279ab7dc72021-07-07 08:02:55 +010054 apk update && \
55 apk add wget && \
danielhanrahan99245172022-07-13 15:33:48 +010056 wget -nv https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz && \
rameshiyer279ab7dc72021-07-07 08:02:55 +010057 tar xvf helm-v3.5.2-linux-amd64.tar.gz && \
58 mv linux-amd64/helm /usr/local/bin && \
59 rm -rf linux-amd64 && \
60 rm helm-v3.5.2-linux-amd64.tar.gz && \
danielhanrahan99245172022-07-13 15:33:48 +010061 wget -nv https://storage.googleapis.com/kubernetes-release/release/v1.21.1/bin/linux/amd64/kubectl && \
rameshiyer279ab7dc72021-07-07 08:02:55 +010062 chmod +x kubectl && \
63 mv kubectl /usr/local/bin/kubectl
64
rameshiyer274334af12021-07-16 07:27:16 +010065EXPOSE 8083
rameshiyer279ab7dc72021-07-07 08:02:55 +010066
67USER policy
68WORKDIR $POLICY_HOME/bin
69ENTRYPOINT [ "./kubernetes-participant.sh" ]
70
71