BjornMagnussonXA | 31b0988 | 2021-06-02 01:56:26 +0200 | [diff] [blame] | 1 | # ============LICENSE_START=============================================== |
| 2 | # Copyright (C) 2020 Nordix Foundation. All rights reserved. |
| 3 | # ======================================================================== |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # ============LICENSE_END================================================= |
| 16 | # |
| 17 | |
BjornMagnussonXA | a439ccb | 2021-09-14 14:44:08 +0200 | [diff] [blame] | 18 | FROM curlimages/curl:7.78.0 AS build |
| 19 | |
| 20 | #Get helm |
| 21 | RUN curl -Lo /tmp/helm.tar.gz https://get.helm.sh/helm-v3.6.1-linux-amd64.tar.gz |
| 22 | |
| 23 | #Get kubectl |
| 24 | RUN curl -Lo /tmp/kubectl https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl |
| 25 | |
| 26 | |
BjornMagnussonXA | 31b0988 | 2021-06-02 01:56:26 +0200 | [diff] [blame] | 27 | FROM openjdk:11-jre-slim |
| 28 | |
BjornMagnussonXA | 31b0988 | 2021-06-02 01:56:26 +0200 | [diff] [blame] | 29 | #Install helm |
BjornMagnussonXA | a439ccb | 2021-09-14 14:44:08 +0200 | [diff] [blame] | 30 | COPY --from=build /tmp/helm.tar.gz . |
| 31 | |
elinuxhenrik | a7598e8 | 2021-06-23 15:57:22 +0200 | [diff] [blame] | 32 | RUN tar -zxvf helm.tar.gz |
BjornMagnussonXA | a439ccb | 2021-09-14 14:44:08 +0200 | [diff] [blame] | 33 | |
elinuxhenrik | a7598e8 | 2021-06-23 15:57:22 +0200 | [diff] [blame] | 34 | RUN mv linux-amd64/helm /usr/local/bin/helm |
BjornMagnussonXA | 31b0988 | 2021-06-02 01:56:26 +0200 | [diff] [blame] | 35 | |
BjornMagnussonXA | a439ccb | 2021-09-14 14:44:08 +0200 | [diff] [blame] | 36 | #Install kubectl |
| 37 | COPY --from=build /tmp/kubectl . |
BjornMagnussonXA | 31b0988 | 2021-06-02 01:56:26 +0200 | [diff] [blame] | 38 | |
| 39 | RUN chmod +x ./kubectl |
| 40 | |
| 41 | RUN mv ./kubectl /usr/local/bin/kubectl |
| 42 | |
| 43 | # Copy app config and app jar |
| 44 | WORKDIR /opt/app/helm-manager/src/main/resources/config |
| 45 | |
| 46 | COPY config/KubernetesParticipantConfig.json . |
| 47 | COPY config/application.yaml . |
| 48 | |
| 49 | WORKDIR /opt/app/helm-manager |
| 50 | COPY target/app.jar app.jar |
| 51 | |
| 52 | CMD [ "java", "-jar", "app.jar" ] |