From 7831ca6e2d364b0b30006608c2b5e4cdf04a5fa2 Mon Sep 17 00:00:00 2001 From: Tomas Prokop Date: Thu, 25 Jun 2026 17:36:47 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20per-arch=20PowerShell=20install=20(amd64?= =?UTF-8?q?=3D.deb,=20arm64=3D.tar.gz=20=E2=80=94=20no=20arm64=20.deb=20pu?= =?UTF-8?q?blished)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/images/power-platform/Dockerfile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/images/power-platform/Dockerfile b/src/images/power-platform/Dockerfile index 4296f53..3f6595b 100644 --- a/src/images/power-platform/Dockerfile +++ b/src/images/power-platform/Dockerfile @@ -32,16 +32,22 @@ RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash \ && rm -rf /var/lib/apt/lists/* /tmp/* # ── PowerShell ──────────────────────────────────────────────────────────────── -# Direct .deb from GitHub releases — avoids PMC/dotnet package conflicts and -# works on amd64 + arm64 without adding Microsoft apt repos to the base image. +# amd64: .deb from GitHub releases (no PMC repo = no dotnet package conflicts) +# arm64: .tar.gz (no arm64 .deb is published) RUN ARCH=$(dpkg --print-architecture) \ && PWSH_VERSION=$(curl -fsSL https://api.github.com/repos/PowerShell/PowerShell/releases/latest \ | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/') \ - && curl -fsSL "https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell_${PWSH_VERSION}-1.deb_${ARCH}.deb" \ - -o /tmp/powershell.deb \ - && dpkg -i /tmp/powershell.deb \ - && apt-get install -f -y \ - && rm /tmp/powershell.deb \ + && if [ "$ARCH" = "amd64" ]; then \ + curl -fsSL "https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell_${PWSH_VERSION}-1.deb_amd64.deb" \ + -o /tmp/powershell.deb \ + && dpkg -i /tmp/powershell.deb && apt-get install -f -y && rm /tmp/powershell.deb; \ + else \ + mkdir -p /opt/microsoft/powershell/7 \ + && curl -fsSL "https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell-${PWSH_VERSION}-linux-arm64.tar.gz" \ + | tar -xz -C /opt/microsoft/powershell/7 \ + && chmod +x /opt/microsoft/powershell/7/pwsh \ + && ln -sf /opt/microsoft/powershell/7/pwsh /usr/local/bin/pwsh; \ + fi \ && rm -rf /var/lib/apt/lists/* # ── Terraform ─────────────────────────────────────────────────────────────────