rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2021 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 | |
| 21 | # |
liamfallon | 4309804 | 2022-01-25 19:55:43 +0000 | [diff] [blame] | 22 | # Docker file to build an image that runs the CLAMP ACM K8S Participant on Java 11 or better in alpine |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 23 | # |
liamfallon | 928e670 | 2022-04-27 20:55:39 +0100 | [diff] [blame] | 24 | FROM onap/policy-jre-alpine:2.4.3 |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 25 | |
| 26 | LABEL maintainer="Policy Team" |
| 27 | |
| 28 | ARG POLICY_LOGS=/var/log/onap/policy/clamp |
| 29 | |
| 30 | ENV POLICY_LOGS=$POLICY_LOGS |
| 31 | ENV POLICY_HOME=$POLICY_HOME/clamp |
| 32 | |
| 33 | RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ |
| 34 | chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \ |
| 35 | mkdir /packages |
| 36 | COPY /maven/lib/kubernetes-participant.tar.gz /packages |
| 37 | |
| 38 | RUN tar xvfz /packages/kubernetes-participant.tar.gz --directory $POLICY_HOME && \ |
FrancescoFioraEst | 252a4bb | 2021-07-23 15:53:46 +0100 | [diff] [blame] | 39 | rm /packages/kubernetes-participant.tar.gz |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 40 | |
| 41 | WORKDIR $POLICY_HOME |
| 42 | COPY kubernetes-participant.sh bin/. |
| 43 | COPY /maven/app.jar /app |
| 44 | |
| 45 | RUN chown -R policy:policy * && \ |
| 46 | chmod 755 bin/*.sh && \ |
| 47 | chown -R policy:policy /app && \ |
| 48 | apk update && \ |
| 49 | apk add wget && \ |
| 50 | wget https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz && \ |
| 51 | tar xvf helm-v3.5.2-linux-amd64.tar.gz && \ |
| 52 | mv linux-amd64/helm /usr/local/bin && \ |
| 53 | rm -rf linux-amd64 && \ |
| 54 | rm helm-v3.5.2-linux-amd64.tar.gz && \ |
| 55 | wget https://storage.googleapis.com/kubernetes-release/release/v1.21.1/bin/linux/amd64/kubectl && \ |
| 56 | chmod +x kubectl && \ |
| 57 | mv kubectl /usr/local/bin/kubectl |
| 58 | |
rameshiyer27 | 4334af1 | 2021-07-16 07:27:16 +0100 | [diff] [blame] | 59 | EXPOSE 8083 |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 60 | |
| 61 | USER policy |
| 62 | WORKDIR $POLICY_HOME/bin |
| 63 | ENTRYPOINT [ "./kubernetes-participant.sh" ] |
| 64 | |
| 65 | |