FROM docker.io/alpine:latest as downloader RUN apk add -U --no-cache curl jq && \ export KUSTOMIZE_VERSION=$(curl https://api.github.com/repos/kubernetes-sigs/kustomize/releases | jq -r '[.[] | select(.tag_name | startswith("kustomize/"))] | first |.tag_name | capture("(?[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+)") | .version') && \ curl -L "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz" | tar xvz -C /tmp && \ curl -L -o /tmp/kubectl "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ chmod +x /tmp/kubectl FROM docker.io/alpine:latest COPY --from=downloader /tmp/kustomize /usr/local/bin/ COPY --from=downloader /tmp/kubectl /usr/local/bin/