blob: b50767cfb06e29bafe40af4db192a9b2604d497a [file] [log] [blame]
elinuxhenrik115e1092022-04-05 09:29:33 +02001# ============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
18FROM curlimages/curl:7.78.0 AS build
19
20#Get helm
21RUN curl -Lo /tmp/helm.tar.gz https://get.helm.sh/helm-v3.6.1-linux-amd64.tar.gz
22
23#Get kubectl
24RUN curl -Lo /tmp/kubectl https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl
25
26
27FROM openjdk:11-jre-slim
28
29#Install helm
30COPY --from=build /tmp/helm.tar.gz .
31
32RUN tar -zxvf helm.tar.gz
33
34RUN mv linux-amd64/helm /usr/local/bin/helm
35
36#Install kubectl
37COPY --from=build /tmp/kubectl .
38
39RUN chmod +x ./kubectl
40
41RUN mv ./kubectl /usr/local/bin/kubectl
42
43WORKDIR /etc/app/helm-manager
44COPY config/application.yaml .
45
46WORKDIR /opt/app/helm-manager
47COPY target/app.jar app.jar
48
49ARG user=nonrtric
50ARG group=nonrtric
51
52RUN groupadd $group && \
53 useradd -r -g $group $user
54RUN chown -R $user:$group /opt/app/helm-manager
55RUN chown -R $user:$group /etc/app/helm-manager
56
57RUN mkdir /var/helm-manager-service
58RUN chown -R $user:$group /var/helm-manager-service
59
60RUN mkdir /home/$user
61RUN chown -R $user:$group /home/$user
62
63USER $user
64
65CMD [ "java", "-jar", "app.jar", "--spring.config.location=optional:file:/etc/app/helm-manager/"]