rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # ============LICENSE_START======================================================= |
danielhanrahan | 54c12dd | 2022-06-28 16:55:46 +0100 | [diff] [blame] | 3 | # Copyright (C) 2021-2022 Nordix Foundation. |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 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 | |
danielhanrahan | cd21359 | 2022-07-11 18:14:13 +0100 | [diff] [blame^] | 21 | FROM busybox AS tarball |
| 22 | RUN mkdir /packages /extracted |
| 23 | COPY /maven/lib/kubernetes-participant.tar.gz /packages/ |
| 24 | RUN tar xvzf /packages/kubernetes-participant.tar.gz --directory /extracted/ |
| 25 | |
liamfallon | 928e670 | 2022-04-27 20:55:39 +0100 | [diff] [blame] | 26 | FROM onap/policy-jre-alpine:2.4.3 |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 27 | |
| 28 | LABEL maintainer="Policy Team" |
danielhanrahan | 54c12dd | 2022-06-28 16:55:46 +0100 | [diff] [blame] | 29 | LABEL org.opencontainers.image.title="Policy CLAMP ACM K8S Participant" |
| 30 | LABEL org.opencontainers.image.description="Policy CLAMP ACM K8S Participant image based on Alpine" |
| 31 | LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp" |
| 32 | LABEL org.opencontainers.image.vendor="ONAP Policy Team" |
| 33 | LABEL org.opencontainers.image.licenses="Apache-2.0" |
| 34 | LABEL org.opencontainers.image.created="${git.build.time}" |
| 35 | LABEL org.opencontainers.image.version="${git.build.version}" |
| 36 | LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}" |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 37 | |
rameshiyer27 | 6131802 | 2022-07-05 23:08:44 +0100 | [diff] [blame] | 38 | ARG POLICY_LOGS=/var/log/onap/policy/k8s-participant |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 39 | |
| 40 | ENV POLICY_LOGS=$POLICY_LOGS |
| 41 | ENV POLICY_HOME=$POLICY_HOME/clamp |
| 42 | |
danielhanrahan | cd21359 | 2022-07-11 18:14:13 +0100 | [diff] [blame^] | 43 | RUN mkdir -p $POLICY_HOME $POLICY_LOGS && \ |
| 44 | chown -R policy:policy $POLICY_HOME $POLICY_LOGS |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 45 | |
danielhanrahan | cd21359 | 2022-07-11 18:14:13 +0100 | [diff] [blame^] | 46 | COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 47 | |
| 48 | WORKDIR $POLICY_HOME |
danielhanrahan | cd21359 | 2022-07-11 18:14:13 +0100 | [diff] [blame^] | 49 | COPY --chown=policy:policy kubernetes-participant.sh bin/ |
| 50 | COPY --chown=policy:policy /maven/policy-clamp-participant-impl-kubernetes.jar /app/app.jar |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 51 | |
danielhanrahan | cd21359 | 2022-07-11 18:14:13 +0100 | [diff] [blame^] | 52 | RUN chmod 755 bin/*.sh && \ |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 53 | apk update && \ |
| 54 | apk add wget && \ |
| 55 | wget https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz && \ |
| 56 | tar xvf helm-v3.5.2-linux-amd64.tar.gz && \ |
| 57 | mv linux-amd64/helm /usr/local/bin && \ |
| 58 | rm -rf linux-amd64 && \ |
| 59 | rm helm-v3.5.2-linux-amd64.tar.gz && \ |
| 60 | wget https://storage.googleapis.com/kubernetes-release/release/v1.21.1/bin/linux/amd64/kubectl && \ |
| 61 | chmod +x kubectl && \ |
| 62 | mv kubectl /usr/local/bin/kubectl |
| 63 | |
rameshiyer27 | 4334af1 | 2021-07-16 07:27:16 +0100 | [diff] [blame] | 64 | EXPOSE 8083 |
rameshiyer27 | 9ab7dc7 | 2021-07-07 08:02:55 +0100 | [diff] [blame] | 65 | |
| 66 | USER policy |
| 67 | WORKDIR $POLICY_HOME/bin |
| 68 | ENTRYPOINT [ "./kubernetes-participant.sh" ] |
| 69 | |
| 70 | |