Improve dockerfile

This way the layer cache will work, while properly
detecting new kubectl releases
This commit is contained in:
Stéphane Bidoul 2022-01-26 18:00:33 +01:00
parent 5955def4b8
commit b0ee0172be
No known key found for this signature in database
GPG key ID: BCAB2555446B5B92

View file

@ -2,8 +2,9 @@ FROM python:3.10
LABEL maintainer="Stéphane Bidoul" LABEL maintainer="Stéphane Bidoul"
ADD https://dl.k8s.io/release/stable.txt /tmp/kubectl-version.txt
RUN curl -L \ RUN curl -L \
"https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ "https://dl.k8s.io/release/$(cat /tmp/kubectl-version.txt)/bin/linux/amd64/kubectl" \
-o /usr/local/bin/kubectl \ -o /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl