Skip to content

Commit d284a89

Browse files
davidwesstdpaquette
authored andcommitted
Include DevContainer for Development Environment (#126)
* added baseline C# functions devcontainer config. #124 * added some extensions and tool installs. #124 * added node, docker, and dotnet-install sdk scripts. #124 * added missing comma * installing .net 5 and 6 sdks in dockerfile. #124 * added vnc desktop testing and first-build script to confirm environment is working immediately. #124 * added azurite to first-build script for setup * finished adding scripts for cosmosdb emulator and database setup. #124 * minor fixes and removed github feature for now. #124 * adding config files on first build. #124 * fixed typo * refreshed start-stop script and VSCode tasks for managing CosmosDB emulator * added gh cli * added task for vscode for cosmosdb * added tasks and settings to run azure function vscode extension * minor update to gitignore and linux compatible run command * reverted npm script command back to windows style * Added labels to tasks.json * increased sleep time to give cosmosdb more time to startup
1 parent 5ae855f commit d284a89

File tree

12 files changed

+734
-1
lines changed

12 files changed

+734
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Find the Dockerfile for mcr.microsoft.com/azure-functions/dotnet:3.0-dotnet3-core-tools at this URL
2+
# https://github.com/Azure/azure-functions-docker/blob/main/host/3.0/buster/amd64/dotnet/dotnet-core-tools.Dockerfile
3+
FROM mcr.microsoft.com/azure-functions/dotnet:3.0-dotnet3-core-tools
4+
5+
# Uncomment following lines If you want to enable Development Container Script
6+
# For more details https://github.com/microsoft/vscode-dev-containers/tree/main/script-library
7+
8+
# Avoid warnings by switching to noninteractive
9+
# ENV DEBIAN_FRONTEND=noninteractive
10+
11+
# # Comment out these lines if you want to use zsh.
12+
13+
ARG INSTALL_ZSH=false
14+
ARG USERNAME=vscode
15+
ARG USER_UID=1000
16+
ARG USER_GID=$USER_UID
17+
18+
RUN apt-get update && curl -ssL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh -o /tmp/common-script.sh \
19+
&& /bin/bash /tmp/common-script.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID" \
20+
&& rm /tmp/common-script.sh
21+
22+
# Setup .NET 5 & 6 SDKs
23+
RUN wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
24+
RUN dpkg -i packages-microsoft-prod.deb
25+
RUN rm packages-microsoft-prod.deb
26+
RUN apt-get update \
27+
&& apt-get install -y apt-transport-https \
28+
&& apt-get update \
29+
&& apt-get install -y dotnet-sdk-5.0 \
30+
&& apt-get install -y dotnet-sdk-6.0
31+
32+
# Install Chrome for Desktop Testing through VNC
33+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
34+
&& curl -sSL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /tmp/chrome.deb \
35+
&& apt-get -y install /tmp/chrome.deb

.devcontainer/devcontainer.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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.209.6/containers/azure-functions-dotnetcore-3.1
3+
{
4+
"name": "TwoWeeksReady",
5+
"dockerFile": "Dockerfile",
6+
"forwardPorts": [ 7071, 6080, 5901 ],
7+
8+
// Set *default* container specific settings.json values on container create.
9+
"settings": {},
10+
11+
// Add the IDs of extensions you want installed when the container is created.
12+
"extensions": [
13+
"ms-azuretools.vscode-azurefunctions",
14+
"ms-dotnettools.csharp",
15+
"azurite.azurite",
16+
//"ms-azuretools.vscode-cosmosdb"
17+
// unable to get preview extension working through devcontainer emulator due to certificate error, but works with deprecated feature in Azure Storage Explorer
18+
],
19+
20+
"features": {
21+
"docker-in-docker": {
22+
"version": "latest",
23+
"moby": true
24+
},
25+
"node": {
26+
"version": "lts",
27+
"nodeGypDependencies": true
28+
},
29+
"desktop-lite": {
30+
"password": "vscode",
31+
"webPort": "6080",
32+
"vncPort": "5901"
33+
},
34+
"github-cli": "latest"
35+
},
36+
37+
// Use 'postCreateCommand' to run commands after the container is created.
38+
"postCreateCommand": "bash -i tools/first-build.sh",
39+
40+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
41+
"remoteUser": "vscode"
42+
}

0 commit comments

Comments
 (0)