Skip to content

Commit 0bad939

Browse files
[dotnet] - remove ubuntu:noble's ubuntu user capturing 1000 uid & gid (#1178)
* [dotnet] - remove ubuntu:noble's ubuntu user capturing 1000 uid & gid * changes as required * pinning to 1000 for vscode user * as required
1 parent 3c984d6 commit 0bad939

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/dotnet/.devcontainer/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ ARG VARIANT=9.0-bookworm-slim
22
FROM mcr.microsoft.com/dotnet/sdk:${VARIANT}
33
ENV PATH $PATH:/home/vscode/.dotnet:/home/vscode/.dotnet/tools
44

5+
ARG VARIANT
6+
RUN if [ "${VARIANT#*noble}" != "$VARIANT" ]; then \
7+
if id "ubuntu" &>/dev/null; then \
8+
echo "Deleting user 'ubuntu' for $VARIANT" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user for $VARIANT"; \
9+
else \
10+
echo "User 'ubuntu' does not exist for $VARIANT"; \
11+
fi; \
12+
fi
13+
514
# clear this environment variable so xml docs from NuGet packages are unpackaged. The default dotnet/sdk image sets it to 'skip'.
615
# see https://github.com/dotnet/dotnet-docker/issues/2790
716
ENV NUGET_XMLDOC_MODE=

src/dotnet/.devcontainer/devcontainer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"ghcr.io/devcontainers/features/common-utils:2": {
88
"installZsh": "true",
99
"username": "vscode",
10-
"upgradePackages": "true"
10+
"upgradePackages": "true",
11+
"userUid": "1000",
12+
"userGid": "1000"
1113
},
1214
"ghcr.io/devcontainers/features/node:1": {
1315
"version": "none"

0 commit comments

Comments
 (0)