File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,11 +123,12 @@ RUN if [ "$INSTALL_TERRAFORM" = "true" ]; then \
123123
124124# Install kubectl if requested
125125RUN if [ "$INSTALL_KUBECTL" = "true" ]; then \
126- KUBECTL_CHANNEL="$(curl -fsSL https://dl.k8s.io/release/stable.txt | sed -E 's/^v([0-9]+\. [0-9]+).*/v\1 /')" \
127- && curl -fsSL "https://pkgs.k8s.io/core:/stable:/${KUBECTL_CHANNEL}/deb/Release.key" | gpg --dearmor -o /usr/share/keyrings/kubernetes-apt-keyring.gpg \
128- && echo "deb [signed-by=/usr/share/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/${KUBECTL_CHANNEL}/deb/ /" > /etc/apt/sources.list.d/kubernetes.list \
129- && apt-get update \
130- && apt-get install -y kubectl; \
126+ KUBECTL_VERSION="$(curl -fsSL https://dl.k8s.io/release/stable.txt)" \
127+ && curl -fsSLo /tmp/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \
128+ && curl -fsSLo /tmp/kubectl.sha256 "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256" \
129+ && echo "$(cat /tmp/kubectl.sha256) /tmp/kubectl" | sha256sum --check \
130+ && install -o root -g root -m 0755 /tmp/kubectl /usr/local/bin/kubectl \
131+ && rm -f /tmp/kubectl /tmp/kubectl.sha256; \
131132 fi
132133
133134# Install Helm if requested
You can’t perform that action at this time.
0 commit comments