Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Dotnet] Fix powershell errors with arm64
  • Loading branch information
samruddhikhandale committed Feb 9, 2024
commit 486e475d1fa15760d144697a20d4a21cd269250a
29 changes: 21 additions & 8 deletions src/dotnet/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,24 @@ ENV NUGET_XMLDOC_MODE=
# Temporary: Upgrade packages due to mentioned CVEs
# They are installed by the base image (mcr.microsoft.com/dotnet/sdk) which does not have the patch.
# https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-0057
RUN apt-get update && \
apt-get install -y wget && \
ARCHITECTURE=$(dpkg --print-architecture) && \
POWERSHELL_FILE_NAME="powershell_7.4.1-1.deb_${ARCHITECTURE}.deb" && \
wget https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/${POWERSHELL_FILE_NAME} && \
dpkg -i ${POWERSHELL_FILE_NAME} && \
apt-get install -f && \
rm ${POWERSHELL_FILE_NAME}
RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
apt-get update && \
apt-get install -y wget && \
POWERSHELL_FILE_NAME="powershell_7.4.1-1.deb_amd64.deb" && \
wget https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/${POWERSHELL_FILE_NAME} && \
dpkg -i ${POWERSHELL_FILE_NAME} && \
apt-get install -f && \
rm ${POWERSHELL_FILE_NAME} ; \
fi

RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \
apt-get update && \
apt-get install -y curl tar && \
POWERSHELL_FILE_PATH="/opt/microsoft/powershell/7" && \
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-linux-arm64.tar.gz && \
mkdir -p ${POWERSHELL_FILE_PATH} && \
tar zxf /tmp/powershell.tar.gz -C ${POWERSHELL_FILE_PATH} && \
chmod +x ${POWERSHELL_FILE_PATH}/pwsh && \
ln -snf ${POWERSHELL_FILE_PATH}/pwsh /usr/bin/pwsh && \
rm /tmp/powershell.tar.gz ; \
fi