Simplify PowerShell installation in Dockerfile

Removed the previous PowerShell installation method and added a simpler snap installation command.
This commit is contained in:
Kyle Speight
2026-05-29 23:18:59 -07:00
committed by GitHub
parent 914e236a3b
commit 4ee6936730
+1 -10
View File
@@ -21,16 +21,7 @@ RUN wget -q https://dot.net/v1/dotnet-install.sh \
&& ln -s /usr/share/dotnet /usr/bin/dotnet \
&& rm dotnet-install.sh
# 3. Install PowerShell (FIXED: Map 'noble' to 'ubuntu24.04')
# Instead of directly using the lsb_release codename, explicitly map it or use a fallback
RUN mkdir -p /etc/apt/keyrings \
&& curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /etc/apt/keyrings/microsoft-prod.gpg \
&& MS_CODENAME="$(lsb_release -cs)" \
&& if [ "$MS_CODENAME" = "noble" ]; then MS_CODENAME="jammy"; fi \
&& echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/repos/microsoft-ubuntu${MS_CODENAME}-prod ${MS_CODENAME} main" | tee /etc/apt/sources.list.d/microsoft-ubuntu-prod.list \
&& apt-get update \
&& apt-get install -y powershell \
&& rm -rf /var/lib/apt/lists/*
RUN snap install powershell --classic
# 4. Install remaining dependencies
RUN apt-get update && apt-get install -y \