From 5643b4476bf9430fbb8153b39c173af289100f80 Mon Sep 17 00:00:00 2001 From: Kalle Fagerberg Date: Thu, 6 Oct 2022 12:05:37 +0200 Subject: [PATCH] Updated kubectl & cleaned up Dockerfile Signed-off-by: Kalle Fagerberg --- Dockerfile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index f04ec02..40ff80b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,19 @@ -FROM ubuntu:16.04 -LABEL maintainer="OpenEBS" -RUN apt-get update || true \ - && apt-get install -y curl -ENV KUBE_LATEST_VERSION="v1.15.3" -RUN curl -L https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ - && chmod +x /usr/local/bin/kubectl +FROM ubuntu:22.04 AS build +RUN apt-get update \ + && apt-get install -y curl \ + && rm -rf /var/lib/apt/lists/* + +ARG KUBE_LATEST_VERSION="v1.25.2" +RUN cd /root \ + && curl -LO https://dl.k8s.io/release/${KUBE_LATEST_VERSION}/bin/linux/amd64/kubectl \ + && curl -LO https://dl.k8s.io/release/${KUBE_LATEST_VERSION}/bin/linux/amd64/kubectl.sha256 \ + && echo "$(cat kubectl.sha256) kubectl" | sha256sum --check \ + && chmod -v +x kubectl + +FROM ubuntu:22.04 AS final + +COPY --from=build /root/kubectl /usr/local/bin/kubectl COPY textfile_collector.sh / + +ENTRYPOINT ["/textfile_collector.sh"] +LABEL maintainer="OpenEBS"