Merge pull request #171 from mallardduck/image-validate-binary

Require downloaded kubectl match expected sha
This commit is contained in:
Dan P. 2024-10-28 13:17:54 -04:00 committed by GitHub
commit 0b02a7e5e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -4,7 +4,9 @@ ARG TARGETPLATFORM
ARG KUBERNETES_RELEASE=v1.21.3
WORKDIR /bin
RUN set -x \
&& curl -fsSLO https://dl.k8s.io/release/${KUBERNETES_RELEASE}/bin/${TARGETPLATFORM}/kubectl \
&& curl -fsSLO "https://dl.k8s.io/release/${KUBERNETES_RELEASE}/bin/${TARGETPLATFORM}/kubectl" \
&& curl -LO "https://dl.k8s.io/release/${KUBERNETES_RELEASE}/bin/${TARGETPLATFORM}/kubectl.sha256" \
&& echo "$(cat kubectl.sha256) kubectl" | sha256sum --check \
&& chmod +x kubectl
RUN useradd -u 1000 -U -m kubectl