Skip to content

Commit

Permalink
fix(dockerfile): use deterministic version for kubectl (#4064) (#4066)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spinnakerbot authored and louisjimenez committed Oct 3, 2019
1 parent 6baca90 commit a2c8083
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ 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 && \
rm google-cloud-sdk.zip && \
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

Expand Down

0 comments on commit a2c8083

Please sign in to comment.