From d27426bd8b31e34d150ac617cbc40e0b516c49d1 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Wed, 6 Nov 2024 16:58:05 +0100 Subject: [PATCH] feat(devcontainer): add krew --- containers/apps/devcontainer/Dockerfile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/containers/apps/devcontainer/Dockerfile b/containers/apps/devcontainer/Dockerfile index 0cd72b8c4b2..a87d56cb281 100644 --- a/containers/apps/devcontainer/Dockerfile +++ b/containers/apps/devcontainer/Dockerfile @@ -5,12 +5,31 @@ ARG VERSION ARG CONTAINER_NAME ARG CONTAINER_VER -# Download and set up the binary +# hadolint ignore=DL3008,DL3015,SC2086,SC2155 +RUN \ +apk update && \ + apk --no-cache update && \ + apk --no-cache add \ + sshfs && \ + rm -rf /var/cache/apk/* /tmp/* /var/tmp/* + +# Download and set up the clustertool binary RUN curl -L "https://github.com/truecharts/public/releases/download/v${VERSION}/clustertool_${VERSION}_linux_amd64.tar.gz" -o /tmp/clustertool.tar.gz \ && tar -xzvf /tmp/clustertool.tar.gz -C /usr/local/bin \ && chmod +x /usr/local/bin/clustertool \ && rm /tmp/clustertool.tar.gz +# Download and set up the krew binary +RUN curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew-linux_amd64.tar.gz" + && tar zxvf "krew-linux_amd64.tar.gz" + && ./"krew-linux_amd64" install krew + && rm /tmp/clustertool.tar.gz + +ENV PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + +# add pvmounter to kubectl using crew +RUN kubectl krew install pv-mounter + ENTRYPOINT ["clustertool"] CMD ["--help"]