Skip to content

Commit

Permalink
[dotnet] - Support noble distro and remove stale powershell security …
Browse files Browse the repository at this point in the history
…patch (#1158)

* [dotnet] - powershell fails in other variants

* changes misc.

* misc change

* removed set -x , set +x

* removed uid & gid config options from common-utils

* mistake correction
  • Loading branch information
gauravsaini04 authored Aug 16, 2024
1 parent ad358cf commit 6b46a28
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
27 changes: 1 addition & 26 deletions src/dotnet/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,4 @@ ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools

# clear this environment variable so xml docs from NuGet packages are unpackaged. The default dotnet/sdk image sets it to 'skip'.
# see https://github.com/dotnet/dotnet-docker/issues/2790
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-30045
RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
apt-get update && \
apt-get install -y wget && \
POWERSHELL_FILE_NAME="powershell_7.4.4-1.deb_amd64.deb" && \
wget https://github.com/PowerShell/PowerShell/releases/download/v7.4.4/${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.4/powershell-7.4.4-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
ENV NUGET_XMLDOC_MODE=
2 changes: 0 additions & 2 deletions src/dotnet/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/node:1": {
Expand Down

0 comments on commit 6b46a28

Please sign in to comment.