Skip to content

Commit

Permalink
small change
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravsaini04 committed Aug 23, 2024
1 parent ddcfd33 commit 9c944c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
10 changes: 2 additions & 8 deletions src/base-ubuntu/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ RUN if [ "$VARIANT" = "noble" ]; then \
else \
echo "User ubuntu does not exist"; \
fi; \
# Check for any processes using UID 1000 and kill them
PIDS=$(ps -u 1000 -o pid=) && \
if [ -n "$PIDS" ]; then \
echo "Killing processes with UID 1000"; \
for pid in $PIDS; do \
kill -9 $pid || echo "Failed to kill process $pid"; \
done; \
fi; \
# Double-check if UID 1000 is still in use
if id -u 1000 &>/dev/null; then \
echo "UID 1000 is still in use. Exiting."; \
Expand All @@ -34,6 +26,8 @@ RUN if [ "$VARIANT" = "noble" ]; then \
echo "Modifying user vscode UID" && usermod -u 1000 vscode || echo "Failed to modify vscode UID"; \
echo "Modifying group vscode GID" && groupmod -g 1000 vscode || echo "Failed to modify vscode GID"; \
fi; \
else \
echo "Variant does not contain noble"; \
fi > /tmp/logfile.txt 2>&1

# [Optional] Uncomment this section to install additional OS packages.
Expand Down
7 changes: 2 additions & 5 deletions src/dotnet/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ RUN if [ "${VARIANT#*noble}" != "$VARIANT" ]; then \
else \
echo "User ubuntu does not exist"; \
fi; \
# Check for any processes using UID 1000 and kill them
if ps -u 1000 &>/dev/null; then \
echo "Killing processes with UID 1000"; \
pkill -u 1000 || echo "Failed to kill processes with UID 1000"; \
fi; \
# Ensure UID 1000 is not in use by another user
if id -u 1000 &>/dev/null; then \
echo "UID 1000 is already taken by another user. Exiting."; \
Expand All @@ -30,6 +25,8 @@ RUN if [ "${VARIANT#*noble}" != "$VARIANT" ]; then \
echo "Modifying user vscode UID" && usermod -u 1000 vscode || echo "Failed to modify vscode UID"; \
echo "Modifying group vscode GID" && groupmod -g 1000 vscode || echo "Failed to modify vscode GID"; \
fi; \
else \
echo "Variant does not contain noble"; \
fi > /tmp/logfile.txt 2>&1

# clear this environment variable so xml docs from NuGet packages are unpackaged. The default dotnet/sdk image sets it to 'skip'.
Expand Down

0 comments on commit 9c944c6

Please sign in to comment.