From cce59fb5f02690d9034257e7789fe8dbfa6dc5de Mon Sep 17 00:00:00 2001 From: Markus Keil Date: Wed, 31 Jul 2024 09:28:43 +0200 Subject: [PATCH] make platform specific sops --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index aca21ae..f28940c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM debian:12-slim +ARG TARGETPLATFORM RUN apt update && apt install python3-pip python3 pipx git curl zsh dialog jq yq fzf exa neovim locales -y COPY locale.gen /etc/locale.gen RUN locale-gen @@ -17,7 +18,15 @@ RUN curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opent chmod +x /tmp/install-opentofu.sh && /tmp/install-opentofu.sh --install-method deb # Sops -RUN curl -LO https://github.com/getsops/sops/releases/download/v3.9.0/sops-v3.9.0.linux.amd64 && mv sops-v3.9.0.linux.amd64 /usr/bin/sops && chmod +x /usr/bin/sops +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ + echo "Performing actions specific to AMD64"; \ + curl -LO https://github.com/getsops/sops/releases/download/v3.9.0/sops-v3.9.0.linux.amd64 && mv sops-v3.9.0.linux.amd64 /usr/bin/sops && chmod +x /usr/bin/sops \ + elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ + echo "Performing actions specific to ARM64"; \ + curl -LO https://github.com/getsops/sops/releases/download/v3.9.0/sops-v3.9.0.linux.arm64 && mv sops-v3.9.0.linux.arm64 /usr/bin/sops && chmod +x /usr/bin/sops \ + else \ + echo "Unknown platform"; \ + fi # OhMyZsh RUN /bin/zsh -c 'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"'