Skip to content

Commit 50f786f

Browse files
authored
dev container settings (Azure#17233)
1 parent 554d1ba commit 50f786f

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-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.208.0/containers/dotnet/.devcontainer/base.Dockerfile
2+
3+
# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.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/*, 16, 14, 12, 10
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 autorest" 2>&1

.devcontainer/devcontainer.json

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

0 commit comments

Comments
 (0)