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
8 # http://www.apache.org/licenses/LICENSE-2.0
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=================================================
18 FROM curlimages/curl:7.78.0 AS build
21 RUN curl -Lo /tmp/helm.tar.gz https://get.helm.sh/helm-v3.6.1-linux-amd64.tar.gz
24 RUN curl -Lo /tmp/kubectl https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl
27 FROM openjdk:11-jre-slim
30 COPY --from=build /tmp/helm.tar.gz .
32 RUN tar -zxvf helm.tar.gz
34 RUN mv linux-amd64/helm /usr/local/bin/helm
37 COPY --from=build /tmp/kubectl .
39 RUN chmod +x ./kubectl
41 RUN mv ./kubectl /usr/local/bin/kubectl
43 WORKDIR /etc/app/helm-manager
44 COPY config/application.yaml .
46 WORKDIR /opt/app/helm-manager
47 COPY target/app.jar app.jar
52 RUN groupadd $group && \
53 useradd -r -g $group $user
54 RUN chown -R $user:$group /opt/app/helm-manager
55 RUN chown -R $user:$group /etc/app/helm-manager
57 RUN mkdir /var/helm-manager-service
58 RUN chown -R $user:$group /var/helm-manager-service
61 RUN chown -R $user:$group /home/$user
65 CMD [ "java", "-jar", "app.jar", "--spring.config.location=optional:file:/etc/app/helm-manager/"]