Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
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 \
gauravsaini04 marked this conversation as resolved.
Show resolved Hide resolved
if id "ubuntu" &>/dev/null; then \
samruddhikhandale marked this conversation as resolved.
Show resolved Hide resolved
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
Loading