diff --git a/src/dotnet/.devcontainer/Dockerfile b/src/dotnet/.devcontainer/Dockerfile index 00bafa555..1f8a6f182 100644 --- a/src/dotnet/.devcontainer/Dockerfile +++ b/src/dotnet/.devcontainer/Dockerfile @@ -2,25 +2,6 @@ ARG VARIANT=8.0-bookworm-slim FROM mcr.microsoft.com/dotnet/sdk:${VARIANT} ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools -ARG VARIANT -ENV VARIANT=${VARIANT} - -RUN if [ "${VARIANT#*noble}" != "$VARIANT" ]; then \ - echo "Variant contains noble"; \ - # Check if ubuntu user exists and delete it if it does - if id "ubuntu" &>/dev/null; then \ - echo "Deleting user ubuntu" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user"; \ - echo "Deleting group associated with ubuntu" && groupdel ubuntu || echo "Failed to delete group associated with ubuntu user"; \ - #check if group 1000 and user 1000 is deleted - echo "Checking user at 1000 uid" && getent passwd 1000 || echo "Failed to find user at uid 1000;" \ - echo "Checking group at 1000 gid" && getent group 1000 || echo "Failed to find group at gid 1000"; \ - else \ - echo "User ubuntu does not exist"; \ - fi; \ - else \ - echo "Variant does not contain noble"; \ - fi - # 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= \ No newline at end of file diff --git a/src/dotnet/.devcontainer/devcontainer.json b/src/dotnet/.devcontainer/devcontainer.json index 4653ec348..141b6263e 100644 --- a/src/dotnet/.devcontainer/devcontainer.json +++ b/src/dotnet/.devcontainer/devcontainer.json @@ -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": { diff --git a/src/dotnet/test-project/test.sh b/src/dotnet/test-project/test.sh index e577eb748..d1d9b89da 100755 --- a/src/dotnet/test-project/test.sh +++ b/src/dotnet/test-project/test.sh @@ -29,18 +29,5 @@ check "usr-local-etc-config-does-not-exist" test ! -f "/usr/local/etc/gitconfig" checkPackageVersion "pwsh" "7.4.4" "PowerShell" -os_release=$(cat /etc/os-release) -# Check if the output contains "NAME=Ubuntu" and "VERSION=24.04" -if echo "$os_release" | grep -q "NAME=\"Ubuntu\"" && echo "$os_release" | grep -q "VERSION=\"24.04"; then - check "Find ubuntu User" bash -c "grep 'ubuntu' /etc/passwd || echo 'ubuntu user not found.'" - check "Find ubuntu Group" bash -c "grep 'ubuntu' /etc/group || echo 'ubuntu group not found.'" - check "Find vscode User" bash -c "grep 'vscode' /etc/passwd || echo 'vscode user not found.'" - check "Find vscode Group" bash -c "grep 'vscode' /etc/group || echo 'vscode group not found.'" - - check "log file contents" bash -c "cat /tmp/logfile.txt" - check "all users" bash -c "cat /etc/passwd" - check "uid" bash -c "id -u vscode | grep 1000" -fi - # Report result reportResults