Open andyli opened 4 months ago
If you happen to have a docker container with your infrastructure tools, the best workaround I can come up with is to override the OS and ARCH. In the Dockerfile for our infrastructure toolbox container, I force the OS and ARCH to versions that my MacbookPro can emulate. Not pretty, but it works.
Add krew "get-all" plugin, override arch/os
diff --git a/Dockerfile b/Dockerfile
index 962326310..dbfb33b9d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -295,6 +295,12 @@ RUN ( set -x; cd "$(mktemp -d)" && \
./"${KREW}" install krew )
RUN export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" && kubectl krew install ${KREW_PLUGINS}
+# Install Krew plugin, overriding ARCH and OS (Emulated on a Mac)
+ARG KREW_PLUGINS_OSARCH="get-all" # list of plugin: "plugin1 plugin2"
+RUN ( set -x; \
+ export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" && \
+ KREW_OS="linux" KREW_ARCH="amd64" kubectl krew install ${KREW_PLUGINS_OSARCH} )
+
COPY rootfs/ /
COPY stacks/ /stacks/
COPY components/ /components/
Would be great if Linux arm64 builds are provided.
Currently,
kubectl krew install get-all
fails: