|
1 | 1 | // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: |
2 | 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/dotnetcore-3.1 |
3 | 3 | { |
4 | | - "name": "C# (.NET Core 3.1)", |
5 | | - "dockerFile": "Dockerfile", |
6 | | - // Set *default* container specific settings.json values on container create. |
7 | | - "settings": { |
8 | | - "terminal.integrated.shell.linux": "/bin/bash" |
| 4 | + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", |
| 5 | + "features": { |
| 6 | + "ghcr.io/devcontainers/features/dotnet:2": { |
| 7 | + "additionalVersions": "lts" |
| 8 | + } |
| 9 | + }, |
| 10 | + "customizations": { |
| 11 | + // Set *default* container specific settings.json values on container create. |
| 12 | + "settings": { |
| 13 | + "omnisharp.enableMsBuildLoadProjectsOnDemand": true, |
| 14 | + "omnisharp.enableRoslynAnalyzers": true, |
| 15 | + "omnisharp.enableEditorConfigSupport": true, |
| 16 | + "omnisharp.enableImportCompletion": true |
| 17 | + }, |
| 18 | + // Configure properties specific to VS Code. |
| 19 | + "vscode": { |
| 20 | + // Add the IDs of extensions you want installed when the container is created. |
| 21 | + "extensions": [ |
| 22 | + "github.vscode-github-actions", |
| 23 | + "ms-dotnettools.csdevkit", |
| 24 | + "EditorConfig.EditorConfig", |
| 25 | + "dbaeumer.vscode-eslint" |
| 26 | + ] |
| 27 | + } |
9 | 28 | }, |
10 | | - // Add the IDs of extensions you want installed when the container is created. |
11 | | - "extensions": [ |
12 | | - "editorconfig.editorconfig", |
13 | | - "jchannon.csharpextensions", |
14 | | - "k--kato.docomment", |
15 | | - "ms-dotnettools.csharp" |
16 | | - ], |
17 | | - // Use 'forwardPorts' to make a list of ports inside the container available locally. |
18 | | - // "forwardPorts": [5000, 5001], |
19 | | - // [Optional] To reuse of your local HTTPS dev cert, first export it locally using this command: |
20 | | - // * Windows PowerShell: |
21 | | - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" |
22 | | - // * macOS/Linux terminal: |
23 | | - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" |
24 | | - // |
25 | | - // Next, after running the command above, uncomment lines in the 'mounts' and 'remoteEnv' lines below, |
26 | | - // and open / rebuild the container so the settings take effect. |
27 | | - // |
28 | | - "remoteUser": "vscode", |
29 | 29 | "mounts": [ |
30 | | - "source=vscode-extensions,target=/home/vscode/.vscode-server/extensions,type=volume", |
31 | | - // And/or for VS Code Insiders |
32 | | - "source=vscode-insiders,target=/home/vscode/.vscode-server-insiders/extensions,type=volume", |
| 30 | + // user profile |
| 31 | + "source=profile,target=/home/vscode,type=volume", |
| 32 | + // vscode extensions |
| 33 | + "target=/vscode/.vscode-server,type=volume", |
| 34 | + // bash history |
| 35 | + //"source=dddseed-bashhistory,target=/commandhistory,type=volume" |
| 36 | + // ssh config for git |
| 37 | + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh/,target=/home/vscode/.ssh,type=bind,consistency=cached" |
| 38 | + // personal NuGet.Config for any api keys |
| 39 | + //"source=${localEnv:APPDATA}/NuGet/NuGet.config,target=/home/vscode/.nuget/NuGet/NuGet.Config,type=bind,consistency=cached" |
33 | 40 | ], |
34 | 41 | "remoteEnv": { |
35 | | - // "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", |
36 | | - // "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx", |
| 42 | + // move Nuget global packages store to a directory where user vscode has write access |
| 43 | + // because the NuGet.Config mount below is mounted as readonly |
| 44 | + // "NUGET_PACKAGES": "/home/vscode/.cache/nuget/packages" |
37 | 45 | }, |
38 | | - //"postCreateCommand": "sudo chown vscode dotnet" |
| 46 | + //"postCreateCommand": "dotnet restore", |
| 47 | + "remoteUser": "vscode" |
39 | 48 | } |
0 commit comments