Changed hm Dockerfile to multistage build
[nonrtric.git] / helm-manager / Dockerfile
index c54b615..90164fd 100644 (file)
 #  ============LICENSE_END=================================================
 #
 
-FROM adoptopenjdk/openjdk11:jre-11.0.11_9-alpine
+FROM curlimages/curl:7.78.0 AS build
 
-ARG JAR
+#Get helm
+RUN curl -Lo /tmp/helm.tar.gz  https://get.helm.sh/helm-v3.6.1-linux-amd64.tar.gz
 
-#Install wget
-RUN apk update && apk add wget
+#Get kubectl
+RUN curl -Lo /tmp/kubectl  https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl
+
+
+FROM openjdk:11-jre-slim
 
 #Install helm
-RUN wget -O helm.tar.gz https://get.helm.sh/helm-v3.6.1-linux-amd64.tar.gz
+COPY --from=build /tmp/helm.tar.gz .
+
 RUN tar -zxvf helm.tar.gz
+
 RUN mv linux-amd64/helm /usr/local/bin/helm
 
-#Install kubectl and configure
-RUN wget https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl
+#Install kubectl
+COPY --from=build /tmp/kubectl .
 
 RUN chmod +x ./kubectl