Skip to content

Commit

Permalink
[dotnet] - remove ubuntu:noble's ubuntu user capturing 1000 uid & gid (
Browse files Browse the repository at this point in the history
…#1178)

* [dotnet] - remove ubuntu:noble's ubuntu user capturing 1000 uid & gid

* changes as required

* pinning to 1000 for vscode user

* as required
  • Loading branch information
gauravsaini04 authored Sep 26, 2024
1 parent 3c984d6 commit 0bad939
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/dotnet/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ ARG VARIANT=9.0-bookworm-slim
FROM mcr.microsoft.com/dotnet/sdk:${VARIANT}
ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools

ARG VARIANT
RUN if [ "${VARIANT#*noble}" != "$VARIANT" ]; then \
if id "ubuntu" &>/dev/null; then \
echo "Deleting user 'ubuntu' for $VARIANT" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user for $VARIANT"; \
else \
echo "User 'ubuntu' does not exist for $VARIANT"; \
fi; \
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=
4 changes: 3 additions & 1 deletion src/dotnet/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"upgradePackages": "true"
"upgradePackages": "true",
"userUid": "1000",
"userGid": "1000"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "none"
Expand Down

0 comments on commit 0bad939

Please sign in to comment.