Skip to content

Commit c3a41cc

Browse files
Add .devcontainer
1 parent a9f29cc commit c3a41cc

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/dotnet/.devcontainer/base.Dockerfile
2+
3+
# [Choice] .NET version: 6.0, 3.1, 6.0-bullseye, 3.1-bullseye, 6.0-focal, 3.1-focal
4+
ARG VARIANT="6.0-bullseye-slim"
5+
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
6+
7+
# [Choice] Node.js version: none, lts/*, 18, 16, 14
8+
ARG NODE_VERSION="none"
9+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
10+
11+
# [Optional] Uncomment this section to install additional OS packages.
12+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13+
# && apt-get -y install --no-install-recommends <your-package-list-here>
14+
15+
# [Optional] Uncomment this line to install global node packages.
16+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/dotnet
3+
{
4+
"name": "C# (.NET)",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update 'VARIANT' to pick a .NET Core version: 3.1, 6.0
9+
// Append -bullseye or -focal to pin to an OS version.
10+
"VARIANT": "6.0-bullseye",
11+
// Options
12+
"NODE_VERSION": "lts/*"
13+
}
14+
},
15+
16+
// Configure tool-specific properties.
17+
"customizations": {
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+
"ms-dotnettools.csharp",
23+
"aaron-bond.better-comments"
24+
]
25+
}
26+
},
27+
28+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
29+
// "forwardPorts": [5000, 5001],
30+
31+
// [Optional] To reuse of your local HTTPS dev cert:
32+
//
33+
// 1. Export it locally using this command:
34+
// * Windows PowerShell:
35+
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
36+
// * macOS/Linux terminal:
37+
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
38+
//
39+
// 2. Uncomment these 'remoteEnv' lines:
40+
// "remoteEnv": {
41+
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
42+
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
43+
// },
44+
//
45+
// 3. Do one of the following depending on your scenario:
46+
// * When using GitHub Codespaces and/or Remote - Containers:
47+
// 1. Start the container
48+
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
49+
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
50+
//
51+
// * If only using Remote - Containers with a local container, uncomment this line instead:
52+
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
53+
54+
// Use 'postCreateCommand' to run commands after the container is created.
55+
// "postCreateCommand": "dotnet restore",
56+
57+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
58+
"remoteUser": "vscode",
59+
"features": {
60+
"fish": "latest"
61+
}
62+
}

0 commit comments

Comments
 (0)