From f59ade6352c9401e4eab8f534eb35192f3154f6d Mon Sep 17 00:00:00 2001 From: Juan Sebastian Hoyos Ayala Date: Thu, 6 Nov 2025 01:17:10 -0800 Subject: [PATCH] Modernize devcontainer --- .devcontainer/Dockerfile | 30 +++++++++++----- .devcontainer/devcontainer.json | 61 +++++++++++++++++---------------- 2 files changed, 53 insertions(+), 38 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cc806a9ac2..536be65eec 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,12 +1,24 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet/.devcontainer/base.Dockerfile -# For specifics about the dotnet base container see: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/dotnet +# See https://github.com/devcontainers/images/tree/main/src/dotnet/ +ARG VARIANT="10.0-noble" +FROM mcr.microsoft.com/devcontainers/dotnet:${VARIANT} -# [Choice] .NET version: 6.0, 5.0, 3.1, 2.1 -ARG VARIANT="6.0-focal" -FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT} +RUN bash -i -c 'nvm install --lts' && npm install -g @github/copilot -# Set up machine requirements to build the repo RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends cmake clang \ - curl gdb gettext git libicu-dev lldb liblldb-dev libunwind8 \ - llvm make python python-lldb tar wget zip \ No newline at end of file + && apt-get -y install --no-install-recommends \ + clang \ + cmake \ + cpio \ + build-essential \ + python3 \ + curl \ + git \ + lldb \ + llvm \ + liblldb-dev \ + libunwind8 \ + libunwind8-dev \ + liblttng-ust-dev \ + ninja-build \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 41e39612dd..4ee048297d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,42 +1,45 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet { - "name": "C# (.NET)", + "name": "Diagnostics - Contribute", "build": { - "dockerfile": "Dockerfile", - "args": { - // Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0 - "VARIANT": "6.0", - // Options - "NODE_VERSION": "lts/*" - } + "dockerfile": "Dockerfile" }, - - "settings": { - // Loading projects on demand is better for larger codebases - "omnisharp.enableMsBuildLoadProjectsOnDemand": true, - "omnisharp.enableRoslynAnalyzers": true, - "omnisharp.enableEditorConfigSupport": true, - "omnisharp.enableAsyncCompletion": true, + "hostRequirements": { + "cpus": 4, + "memory": "8gb", + "storage": "64gb" }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-dotnettools.csharp", - "ms-vscode.cpptools-extension-pack" - ], - - // Needed to debug sos extension under container. - "privileged": true, + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker": {} + }, + "customizations": { + "codespaces": { + "extensions": [ + "ms-dotnettools.csdevkit", + "GitHub.copilot", + "GitHub.copilot-chat" + ], + "settings": { + "remote.autoForwardPorts": true, + "remote.autoForwardPortsSource": "hybrid", + "remote.otherPortsAttributes": { + "onAutoForward": "ignore" + }, + "dotnet.defaultSolution": "build.sln" + } + } + }, + "postStartCommand": "${containerWorkspaceFolder}/dotnet.sh --info", + "capAdd": [ "SYS_PTRACE" ], // Add the locally installed dotnet to the path to ensure that it is activated // This allows developers to just use 'dotnet build' on the command-line, and the local dotnet version will be used. // Add the global tools dir to the PATH so that globally installed tools will work "remoteEnv": { - "PATH": "${containerWorkspaceFolder}/.dotnet:${containerWorkspaceFolder}/.dotnet-tools-global:${containerEnv:PATH}", - "DOTNET_MULTILEVEL_LOOKUP": "0" + "PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}" }, // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + // This one is defined by common-utils in the dotnet devcontainer base image. "remoteUser": "vscode" -} \ No newline at end of file +}