From a2c8083fe1f953e5476b909ae5231bad4f811c16 Mon Sep 17 00:00:00 2001 From: spinnakerbot Date: Thu, 3 Oct 2019 14:00:43 -0400 Subject: [PATCH] fix(dockerfile): use deterministic version for kubectl (#4064) (#4066) reading from `stable.txt` causes builds to be non-deterministic which could lead to problems in the future. we should be explicit about the version of `kubectl` that we ship. `v1.16.0` was the latest version as of this PR. --- Dockerfile.slim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.slim b/Dockerfile.slim index 45cb8ee1f1c..3ef5f9104e7 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -2,6 +2,8 @@ FROM openjdk:8-jdk-alpine MAINTAINER delivery-engineering@netflix.com +ENV KUBECTL_VERSION v1.16.0 + RUN apk --no-cache add --update bash wget unzip 'python2>2.7.9' && \ wget -nv https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.zip && \ unzip -qq google-cloud-sdk.zip -d /opt && \ @@ -9,8 +11,7 @@ RUN apk --no-cache add --update bash wget unzip 'python2>2.7.9' && \ CLOUDSDK_PYTHON="python2.7" /opt/google-cloud-sdk/install.sh --usage-reporting=false --bash-completion=false --additional-components app-engine-java && \ rm -rf ~/.config/gcloud -RUN wget https://storage.googleapis.com/kubernetes-release/release/stable.txt && wget https://storage.googleapis.com/kubernetes-release/release/$(cat stable.txt)/bin/linux/amd64/kubectl && \ - rm stable.txt && \ +RUN wget https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \ chmod +x kubectl && \ mv ./kubectl /usr/local/bin/kubectl