From ece7573fab36c8ce868fa8c41292b94a90d2795d Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Fri, 12 Apr 2019 11:52:46 -0700 Subject: [PATCH] Improve .NET Core containers, switch to MCR images --- .devcontainer/devcontainer.json | 2 +- .../.devcontainer/Dockerfile | 22 +++++++++++++ .../.devcontainer/devcontainer.json | 9 ++++++ .../.npmignore | 0 .../azure-functions-dotnetcore-2.1/README.md | 23 +++++++++++++ .../.devcontainer/Dockerfile | 22 +++++++++++++ .../.devcontainer/devcontainer.json | 9 ++++++ .../.npmignore | 0 .../README.md | 23 +++++++++++++ .../.devcontainer/Dockerfile | 14 ++++---- containers/azure-functions-node-8/README.md | 2 +- .../.devcontainer/Dockerfile | 16 +++++----- containers/azure-functions-node-lts/README.md | 2 +- .../azure-terraform/.devcontainer/Dockerfile | 2 +- .../.devcontainer/Dockerfile | 4 +-- .../.devcontainer/devcontainer.json | 5 +++ containers/debian-9-git/.npmignore | 4 +++ containers/debian-9-git/README.md | 25 +++++++++++++++ .../.devcontainer/Dockerfile | 2 +- .../.devcontainer/devcontainer.json | 2 +- .../.devcontainer/settings.vscode.json | 0 containers/dotnetcore-2.1-fsharp/.npmignore | 4 +++ .../.vscode/launch.json | 0 .../.vscode/settings.json | 0 .../.vscode/tasks.json | 0 .../README.md | 2 +- .../test-project/Program.fs | 0 .../test-project/app.fsproj | 0 .../dotnetcore-2.1/.devcontainer/Dockerfile | 14 ++++++++ .../.devcontainer/devcontainer.json | 2 +- containers/dotnetcore-2.1/.npmignore | 4 +++ .../.vscode/launch.json | 0 .../.vscode/settings.json | 0 .../README.md | 2 +- .../test-project/Program.cs | 0 .../test-project/aspnetapp.csproj | 0 .../.devcontainer/Dockerfile | 22 +++++++++++++ .../.devcontainer/devcontainer.json | 8 +++++ .../.devcontainer/settings.vscode.json | 3 ++ .../dotnetcore-latest-fsharp/.npmignore | 4 +++ .../.vscode/launch.json | 26 +++++++++++++++ .../.vscode/settings.json | 3 ++ .../.vscode/tasks.json | 17 ++++++++++ containers/dotnetcore-latest-fsharp/README.md | 25 +++++++++++++++ .../test-project/Program.fs | 15 +++++++++ .../test-project/app.fsproj | 13 ++++++++ .../.devcontainer/Dockerfile | 14 ++++++++ .../.devcontainer/devcontainer.json | 8 +++++ containers/dotnetcore-latest/.npmignore | 4 +++ .../dotnetcore-latest/.vscode/launch.json | 16 ++++++++++ .../dotnetcore-latest/.vscode/settings.json | 3 ++ containers/dotnetcore-latest/README.md | 25 +++++++++++++++ .../dotnetcore-latest/test-project/Program.cs | 32 +++++++++++++++++++ .../test-project/aspnetapp.csproj | 12 +++++++ 54 files changed, 440 insertions(+), 26 deletions(-) create mode 100644 containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile create mode 100644 containers/azure-functions-dotnetcore-2.1/.devcontainer/devcontainer.json rename containers/{dotnetcore-2.2-fsharp => azure-functions-dotnetcore-2.1}/.npmignore (100%) create mode 100644 containers/azure-functions-dotnetcore-2.1/README.md create mode 100644 containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile create mode 100644 containers/azure-functions-dotnetcore-latest/.devcontainer/devcontainer.json rename containers/{dotnetcore-2.2 => azure-functions-dotnetcore-latest}/.npmignore (100%) create mode 100644 containers/azure-functions-dotnetcore-latest/README.md rename containers/{dotnetcore-2.2 => debian-9-git}/.devcontainer/Dockerfile (94%) create mode 100644 containers/debian-9-git/.devcontainer/devcontainer.json create mode 100644 containers/debian-9-git/.npmignore create mode 100644 containers/debian-9-git/README.md rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/.devcontainer/Dockerfile (94%) rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/.devcontainer/devcontainer.json (75%) rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/.devcontainer/settings.vscode.json (100%) create mode 100644 containers/dotnetcore-2.1-fsharp/.npmignore rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/.vscode/launch.json (100%) rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/.vscode/settings.json (100%) rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/.vscode/tasks.json (100%) rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/README.md (97%) rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/test-project/Program.fs (100%) rename containers/{dotnetcore-2.2-fsharp => dotnetcore-2.1-fsharp}/test-project/app.fsproj (100%) create mode 100644 containers/dotnetcore-2.1/.devcontainer/Dockerfile rename containers/{dotnetcore-2.2 => dotnetcore-2.1}/.devcontainer/devcontainer.json (73%) create mode 100644 containers/dotnetcore-2.1/.npmignore rename containers/{dotnetcore-2.2 => dotnetcore-2.1}/.vscode/launch.json (100%) rename containers/{dotnetcore-2.2 => dotnetcore-2.1}/.vscode/settings.json (100%) rename containers/{dotnetcore-2.2 => dotnetcore-2.1}/README.md (97%) rename containers/{dotnetcore-2.2 => dotnetcore-2.1}/test-project/Program.cs (100%) rename containers/{dotnetcore-2.2 => dotnetcore-2.1}/test-project/aspnetapp.csproj (100%) create mode 100644 containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile create mode 100644 containers/dotnetcore-latest-fsharp/.devcontainer/devcontainer.json create mode 100644 containers/dotnetcore-latest-fsharp/.devcontainer/settings.vscode.json create mode 100644 containers/dotnetcore-latest-fsharp/.npmignore create mode 100644 containers/dotnetcore-latest-fsharp/.vscode/launch.json create mode 100644 containers/dotnetcore-latest-fsharp/.vscode/settings.json create mode 100644 containers/dotnetcore-latest-fsharp/.vscode/tasks.json create mode 100644 containers/dotnetcore-latest-fsharp/README.md create mode 100644 containers/dotnetcore-latest-fsharp/test-project/Program.fs create mode 100644 containers/dotnetcore-latest-fsharp/test-project/app.fsproj create mode 100644 containers/dotnetcore-latest/.devcontainer/Dockerfile create mode 100644 containers/dotnetcore-latest/.devcontainer/devcontainer.json create mode 100644 containers/dotnetcore-latest/.npmignore create mode 100644 containers/dotnetcore-latest/.vscode/launch.json create mode 100644 containers/dotnetcore-latest/.vscode/settings.json create mode 100644 containers/dotnetcore-latest/README.md create mode 100644 containers/dotnetcore-latest/test-project/Program.cs create mode 100644 containers/dotnetcore-latest/test-project/aspnetapp.csproj diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5da1c458..d2f1db11 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "Dev Container Editing", - "dockerFile": ".devcontainer/Dockerfile", + "dockerFile": "Dockerfile", "extensions": [ "yzhang.markdown-all-in-one", "streetsidesoftware.code-spell-checker", diff --git a/containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile b/containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile new file mode 100644 index 00000000..9e96b102 --- /dev/null +++ b/containers/azure-functions-dotnetcore-2.1/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +#----------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE in the project root for license information. +#----------------------------------------------------------------------------------------- + +FROM mcr.microsoft.com/dotnet/core/sdk:2.1 + +# Install git, process tools, bash +RUN apt-get update && apt-get -y install git procps + +# Install Azure Functions and Azure CLI +RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ + && curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ + && apt-get update \ + && apt-get install -y azure-cli azure-functions-core-tools + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* diff --git a/containers/azure-functions-dotnetcore-2.1/.devcontainer/devcontainer.json b/containers/azure-functions-dotnetcore-2.1/.devcontainer/devcontainer.json new file mode 100644 index 00000000..26a6eded --- /dev/null +++ b/containers/azure-functions-dotnetcore-2.1/.devcontainer/devcontainer.json @@ -0,0 +1,9 @@ +{ + "name": "Azure Functions & C# (.NET Core 2.1)", + "dockerFile": "Dockerfile", + "appPort": 7071, + "extensions": [ + "ms-azuretools.vscode-azurefunctions", + "ms-vscode.csharp" + ] +} \ No newline at end of file diff --git a/containers/dotnetcore-2.2-fsharp/.npmignore b/containers/azure-functions-dotnetcore-2.1/.npmignore similarity index 100% rename from containers/dotnetcore-2.2-fsharp/.npmignore rename to containers/azure-functions-dotnetcore-2.1/.npmignore diff --git a/containers/azure-functions-dotnetcore-2.1/README.md b/containers/azure-functions-dotnetcore-2.1/README.md new file mode 100644 index 00000000..c88571df --- /dev/null +++ b/containers/azure-functions-dotnetcore-2.1/README.md @@ -0,0 +1,23 @@ +# Azure Functions & C# (.NET Core 2.1) + +## Summary + +*A basic dev container definition for building Node.js based Azure Functions in a container. Includes everything you need to get up and running.* + +| Metadata | Value | +|----------|-------| +| *Contributors* | The VS Code Team | +| *Definition type* | Dockerfile | +| *Languages, platforms* | Azure Functions, Node.js, JavaScript | + +## Usage + +[See here for information on using this definition with an existing project](../../README.md#using-a-definition). + +If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](../../LICENSE). diff --git a/containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile b/containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile new file mode 100644 index 00000000..395efc17 --- /dev/null +++ b/containers/azure-functions-dotnetcore-latest/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +#----------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE in the project root for license information. +#----------------------------------------------------------------------------------------- + +FROM mcr.microsoft.com/dotnet/core/sdk:latest + +# Install git, process tools, bash +RUN apt-get update && apt-get -y install git procps + +# Install Azure Functions and Azure CLI +RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ + && curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ + && apt-get update \ + && apt-get install -y azure-cli azure-functions-core-tools + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* diff --git a/containers/azure-functions-dotnetcore-latest/.devcontainer/devcontainer.json b/containers/azure-functions-dotnetcore-latest/.devcontainer/devcontainer.json new file mode 100644 index 00000000..17f5d866 --- /dev/null +++ b/containers/azure-functions-dotnetcore-latest/.devcontainer/devcontainer.json @@ -0,0 +1,9 @@ +{ + "name": "Azure Functions & C# (.NET Core Latest)", + "dockerFile": "Dockerfile", + "appPort": 7071, + "extensions": [ + "ms-azuretools.vscode-azurefunctions", + "ms-vscode.csharp" + ] +} \ No newline at end of file diff --git a/containers/dotnetcore-2.2/.npmignore b/containers/azure-functions-dotnetcore-latest/.npmignore similarity index 100% rename from containers/dotnetcore-2.2/.npmignore rename to containers/azure-functions-dotnetcore-latest/.npmignore diff --git a/containers/azure-functions-dotnetcore-latest/README.md b/containers/azure-functions-dotnetcore-latest/README.md new file mode 100644 index 00000000..447c8de8 --- /dev/null +++ b/containers/azure-functions-dotnetcore-latest/README.md @@ -0,0 +1,23 @@ +# Azure Functions & C# (.NET Core Latest) + +## Summary + +*A basic dev container definition for building Node.js based Azure Functions in a container. Includes everything you need to get up and running.* + +| Metadata | Value | +|----------|-------| +| *Contributors* | The VS Code Team | +| *Definition type* | Dockerfile | +| *Languages, platforms* | Azure Functions, Node.js, JavaScript | + +## Usage + +[See here for information on using this definition with an existing project](../../README.md#using-a-definition). + +If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](../../LICENSE). diff --git a/containers/azure-functions-node-8/.devcontainer/Dockerfile b/containers/azure-functions-node-8/.devcontainer/Dockerfile index c8e3c968..a81f0185 100644 --- a/containers/azure-functions-node-8/.devcontainer/Dockerfile +++ b/containers/azure-functions-node-8/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See LICENSE in the project root for license information. #----------------------------------------------------------------------------------------- -FROM microsoft/dotnet:2.1-sdk-bionic +FROM mcr.microsoft.com/dotnet/core/sdk:2.1 # Install git, process tools, bash RUN apt-get update && apt-get -y install git procps @@ -18,13 +18,13 @@ RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh # Install eslint RUN /bin/bash -c "source $HOME/.nvm/nvm.sh && npm install -g eslint" -# Install Azure Functions -RUN apt-get install -y apt-transport-https \ - && curl -sSO https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \ - && dpkg -i packages-microsoft-prod.deb \ - && rm packages-microsoft-prod.deb \ +# Install Azure Functions and Azure CLI +RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ + && curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ && apt-get update \ - && apt-get install -y azure-functions-core-tools + && apt-get install -y azure-cli azure-functions-core-tools # Clean up RUN apt-get autoremove -y \ diff --git a/containers/azure-functions-node-8/README.md b/containers/azure-functions-node-8/README.md index 05f5e5be..b8c13fa3 100644 --- a/containers/azure-functions-node-8/README.md +++ b/containers/azure-functions-node-8/README.md @@ -1,4 +1,4 @@ -# Azure Functions w/Node.js v8 +# Azure Functions & Node.js 8 ## Summary diff --git a/containers/azure-functions-node-lts/.devcontainer/Dockerfile b/containers/azure-functions-node-lts/.devcontainer/Dockerfile index e02d4f22..08e9e226 100644 --- a/containers/azure-functions-node-lts/.devcontainer/Dockerfile +++ b/containers/azure-functions-node-lts/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See LICENSE in the project root for license information. #----------------------------------------------------------------------------------------- -FROM microsoft/dotnet:2.1-sdk-bionic +FROM mcr.microsoft.com/dotnet/core/sdk:2.1 # Install git, process tools, bash RUN apt-get update && apt-get -y install git procps @@ -18,14 +18,14 @@ RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh # Install eslint RUN /bin/bash -c "source $HOME/.nvm/nvm.sh && npm install -g eslint" -# Install Azure Functions -RUN apt-get install -y apt-transport-https \ - && curl -sSO https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \ - && dpkg -i packages-microsoft-prod.deb \ - && rm packages-microsoft-prod.deb \ +# Install Azure Functions and Azure CLI +RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \ + && echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \ + && curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ && apt-get update \ - && apt-get install -y azure-functions-core-tools - + && apt-get install -y azure-cli azure-functions-core-tools + # Clean up RUN apt-get autoremove -y \ && apt-get clean -y \ diff --git a/containers/azure-functions-node-lts/README.md b/containers/azure-functions-node-lts/README.md index 05f5e5be..bfbcc3da 100644 --- a/containers/azure-functions-node-lts/README.md +++ b/containers/azure-functions-node-lts/README.md @@ -1,4 +1,4 @@ -# Azure Functions w/Node.js v8 +# Azure Functions & Node.js (latest LTS) ## Summary diff --git a/containers/azure-terraform/.devcontainer/Dockerfile b/containers/azure-terraform/.devcontainer/Dockerfile index f8549f91..bacffe4d 100644 --- a/containers/azure-terraform/.devcontainer/Dockerfile +++ b/containers/azure-terraform/.devcontainer/Dockerfile @@ -4,7 +4,7 @@ #----------------------------------------------------------------------------------------- # Pick any base image, but if you select node, skip installing node. 😊 -FROM ubuntu:bionic +FROM debian:9 # Install git, required tools RUN apt-get update \ diff --git a/containers/dotnetcore-2.2/.devcontainer/Dockerfile b/containers/debian-9-git/.devcontainer/Dockerfile similarity index 94% rename from containers/dotnetcore-2.2/.devcontainer/Dockerfile rename to containers/debian-9-git/.devcontainer/Dockerfile index e4c56cc9..f75e9177 100644 --- a/containers/dotnetcore-2.2/.devcontainer/Dockerfile +++ b/containers/debian-9-git/.devcontainer/Dockerfile @@ -2,8 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root for license information. #----------------------------------------------------------------------------------------- - -FROM microsoft/dotnet:2.2-sdk +FROM debian:9 # Install git, process tools RUN apt-get update && apt-get -y install git procps @@ -12,3 +11,4 @@ RUN apt-get update && apt-get -y install git procps RUN apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* + diff --git a/containers/debian-9-git/.devcontainer/devcontainer.json b/containers/debian-9-git/.devcontainer/devcontainer.json new file mode 100644 index 00000000..d06fe67e --- /dev/null +++ b/containers/debian-9-git/.devcontainer/devcontainer.json @@ -0,0 +1,5 @@ +{ + "name": "Debian 9 + Git", + "dockerFile": "Dockerfile", + "appPort": [] +} \ No newline at end of file diff --git a/containers/debian-9-git/.npmignore b/containers/debian-9-git/.npmignore new file mode 100644 index 00000000..1d72d293 --- /dev/null +++ b/containers/debian-9-git/.npmignore @@ -0,0 +1,4 @@ +README.md +test-project +.vscode +.npmignore diff --git a/containers/debian-9-git/README.md b/containers/debian-9-git/README.md new file mode 100644 index 00000000..5c9d70eb --- /dev/null +++ b/containers/debian-9-git/README.md @@ -0,0 +1,25 @@ +# Ubuntu 18.04 + Git + +## Summary + +*A starter container definition with Ubuntu 18.04 and Git installed.* + +| Metadata | Value | +|----------|-------| +| *Contributors* | The VS Code Team | +| *Definition type* | Dockerfile | +| *Languages, platforms* | Any | + +## Usage + +[See here for information on using this definition with an existing project](../../README.md#using-a-definition). + +If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project. + +If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder. You can then start the test program from Debug panel in VS Code. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](../../LICENSE). diff --git a/containers/dotnetcore-2.2-fsharp/.devcontainer/Dockerfile b/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile similarity index 94% rename from containers/dotnetcore-2.2-fsharp/.devcontainer/Dockerfile rename to containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile index 94aabbd6..f517fc5e 100644 --- a/containers/dotnetcore-2.2-fsharp/.devcontainer/Dockerfile +++ b/containers/dotnetcore-2.1-fsharp/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See LICENSE in the project root for license information. #----------------------------------------------------------------------------------------- -FROM microsoft/dotnet:2.2-sdk +FROM mcr.microsoft.com/dotnet/core/sdk:2.1 # Copy endpoint specific user settings overrides into container to specify # .NET Core should be used as the runtime. diff --git a/containers/dotnetcore-2.2-fsharp/.devcontainer/devcontainer.json b/containers/dotnetcore-2.1-fsharp/.devcontainer/devcontainer.json similarity index 75% rename from containers/dotnetcore-2.2-fsharp/.devcontainer/devcontainer.json rename to containers/dotnetcore-2.1-fsharp/.devcontainer/devcontainer.json index 61783b01..cdb5448f 100644 --- a/containers/dotnetcore-2.2-fsharp/.devcontainer/devcontainer.json +++ b/containers/dotnetcore-2.1-fsharp/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "F#", + "name": "F# (.NET Core 2.1)", "dockerFile": "Dockerfile", "extensions": [ "Ionide.Ionide-fsharp", diff --git a/containers/dotnetcore-2.2-fsharp/.devcontainer/settings.vscode.json b/containers/dotnetcore-2.1-fsharp/.devcontainer/settings.vscode.json similarity index 100% rename from containers/dotnetcore-2.2-fsharp/.devcontainer/settings.vscode.json rename to containers/dotnetcore-2.1-fsharp/.devcontainer/settings.vscode.json diff --git a/containers/dotnetcore-2.1-fsharp/.npmignore b/containers/dotnetcore-2.1-fsharp/.npmignore new file mode 100644 index 00000000..1d72d293 --- /dev/null +++ b/containers/dotnetcore-2.1-fsharp/.npmignore @@ -0,0 +1,4 @@ +README.md +test-project +.vscode +.npmignore diff --git a/containers/dotnetcore-2.2-fsharp/.vscode/launch.json b/containers/dotnetcore-2.1-fsharp/.vscode/launch.json similarity index 100% rename from containers/dotnetcore-2.2-fsharp/.vscode/launch.json rename to containers/dotnetcore-2.1-fsharp/.vscode/launch.json diff --git a/containers/dotnetcore-2.2-fsharp/.vscode/settings.json b/containers/dotnetcore-2.1-fsharp/.vscode/settings.json similarity index 100% rename from containers/dotnetcore-2.2-fsharp/.vscode/settings.json rename to containers/dotnetcore-2.1-fsharp/.vscode/settings.json diff --git a/containers/dotnetcore-2.2-fsharp/.vscode/tasks.json b/containers/dotnetcore-2.1-fsharp/.vscode/tasks.json similarity index 100% rename from containers/dotnetcore-2.2-fsharp/.vscode/tasks.json rename to containers/dotnetcore-2.1-fsharp/.vscode/tasks.json diff --git a/containers/dotnetcore-2.2-fsharp/README.md b/containers/dotnetcore-2.1-fsharp/README.md similarity index 97% rename from containers/dotnetcore-2.2-fsharp/README.md rename to containers/dotnetcore-2.1-fsharp/README.md index 1fb87244..d9876cc5 100644 --- a/containers/dotnetcore-2.2-fsharp/README.md +++ b/containers/dotnetcore-2.1-fsharp/README.md @@ -1,4 +1,4 @@ -# F# (.NET Core 2.2) +# F# (.NET Core 2.1) ## Summary diff --git a/containers/dotnetcore-2.2-fsharp/test-project/Program.fs b/containers/dotnetcore-2.1-fsharp/test-project/Program.fs similarity index 100% rename from containers/dotnetcore-2.2-fsharp/test-project/Program.fs rename to containers/dotnetcore-2.1-fsharp/test-project/Program.fs diff --git a/containers/dotnetcore-2.2-fsharp/test-project/app.fsproj b/containers/dotnetcore-2.1-fsharp/test-project/app.fsproj similarity index 100% rename from containers/dotnetcore-2.2-fsharp/test-project/app.fsproj rename to containers/dotnetcore-2.1-fsharp/test-project/app.fsproj diff --git a/containers/dotnetcore-2.1/.devcontainer/Dockerfile b/containers/dotnetcore-2.1/.devcontainer/Dockerfile new file mode 100644 index 00000000..8cd08d48 --- /dev/null +++ b/containers/dotnetcore-2.1/.devcontainer/Dockerfile @@ -0,0 +1,14 @@ +#----------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE in the project root for license information. +#----------------------------------------------------------------------------------------- + +FROM mcr.microsoft.com/dotnet/core/sdk:2.1 + +# Install git, process tools +RUN apt-get update && apt-get -y install git procps + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* diff --git a/containers/dotnetcore-2.2/.devcontainer/devcontainer.json b/containers/dotnetcore-2.1/.devcontainer/devcontainer.json similarity index 73% rename from containers/dotnetcore-2.2/.devcontainer/devcontainer.json rename to containers/dotnetcore-2.1/.devcontainer/devcontainer.json index 99b34377..83697be5 100644 --- a/containers/dotnetcore-2.2/.devcontainer/devcontainer.json +++ b/containers/dotnetcore-2.1/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": ".NET Core 2.2", + "name": "C# (.NET Core 2.1)", "dockerFile": "Dockerfile", "appPort": 8090, "extensions": [ diff --git a/containers/dotnetcore-2.1/.npmignore b/containers/dotnetcore-2.1/.npmignore new file mode 100644 index 00000000..1d72d293 --- /dev/null +++ b/containers/dotnetcore-2.1/.npmignore @@ -0,0 +1,4 @@ +README.md +test-project +.vscode +.npmignore diff --git a/containers/dotnetcore-2.2/.vscode/launch.json b/containers/dotnetcore-2.1/.vscode/launch.json similarity index 100% rename from containers/dotnetcore-2.2/.vscode/launch.json rename to containers/dotnetcore-2.1/.vscode/launch.json diff --git a/containers/dotnetcore-2.2/.vscode/settings.json b/containers/dotnetcore-2.1/.vscode/settings.json similarity index 100% rename from containers/dotnetcore-2.2/.vscode/settings.json rename to containers/dotnetcore-2.1/.vscode/settings.json diff --git a/containers/dotnetcore-2.2/README.md b/containers/dotnetcore-2.1/README.md similarity index 97% rename from containers/dotnetcore-2.2/README.md rename to containers/dotnetcore-2.1/README.md index 3a9ed039..408603ba 100644 --- a/containers/dotnetcore-2.2/README.md +++ b/containers/dotnetcore-2.1/README.md @@ -1,4 +1,4 @@ -# .NET Core 2.2 +# C# (.NET Core 2.1) ## Summary diff --git a/containers/dotnetcore-2.2/test-project/Program.cs b/containers/dotnetcore-2.1/test-project/Program.cs similarity index 100% rename from containers/dotnetcore-2.2/test-project/Program.cs rename to containers/dotnetcore-2.1/test-project/Program.cs diff --git a/containers/dotnetcore-2.2/test-project/aspnetapp.csproj b/containers/dotnetcore-2.1/test-project/aspnetapp.csproj similarity index 100% rename from containers/dotnetcore-2.2/test-project/aspnetapp.csproj rename to containers/dotnetcore-2.1/test-project/aspnetapp.csproj diff --git a/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile b/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile new file mode 100644 index 00000000..8451cadd --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +#----------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE in the project root for license information. +#----------------------------------------------------------------------------------------- + +FROM mcr.microsoft.com/dotnet/core/sdk:latest + +# Copy endpoint specific user settings overrides into container to specify +# .NET Core should be used as the runtime. +COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json + +# Install git, process tools +RUN apt-get update && apt-get -y install git procps + +# Install fsharp +RUN apt-get install -y fsharp + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + diff --git a/containers/dotnetcore-latest-fsharp/.devcontainer/devcontainer.json b/containers/dotnetcore-latest-fsharp/.devcontainer/devcontainer.json new file mode 100644 index 00000000..fb1b31ac --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": "F# (.NET Core Latest)", + "dockerFile": "Dockerfile", + "extensions": [ + "Ionide.Ionide-fsharp", + "ms-vscode.csharp" + ] +} \ No newline at end of file diff --git a/containers/dotnetcore-latest-fsharp/.devcontainer/settings.vscode.json b/containers/dotnetcore-latest-fsharp/.devcontainer/settings.vscode.json new file mode 100644 index 00000000..5b238fae --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/.devcontainer/settings.vscode.json @@ -0,0 +1,3 @@ +{ + "FSharp.fsacRuntime":"netcore" +} \ No newline at end of file diff --git a/containers/dotnetcore-latest-fsharp/.npmignore b/containers/dotnetcore-latest-fsharp/.npmignore new file mode 100644 index 00000000..1d72d293 --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/.npmignore @@ -0,0 +1,4 @@ +README.md +test-project +.vscode +.npmignore diff --git a/containers/dotnetcore-latest-fsharp/.vscode/launch.json b/containers/dotnetcore-latest-fsharp/.vscode/launch.json new file mode 100644 index 00000000..52284bb7 --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/test-project/bin/Debug/netcoreapp2.2/app.dll", + "args": [], + "cwd": "${workspaceFolder}/test-project", + "console": "integratedTerminal", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/containers/dotnetcore-latest-fsharp/.vscode/settings.json b/containers/dotnetcore-latest-fsharp/.vscode/settings.json new file mode 100644 index 00000000..cefd1b44 --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "razor.disabled": true +} \ No newline at end of file diff --git a/containers/dotnetcore-latest-fsharp/.vscode/tasks.json b/containers/dotnetcore-latest-fsharp/.vscode/tasks.json new file mode 100644 index 00000000..f6566619 --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "cd test-project && dotnet build", + "type": "shell", + "group": "build", + "presentation": { + "reveal": "silent" + }, + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/containers/dotnetcore-latest-fsharp/README.md b/containers/dotnetcore-latest-fsharp/README.md new file mode 100644 index 00000000..f4dd7d2f --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/README.md @@ -0,0 +1,25 @@ +# F# (.NET Core Latest) + +## Summary + +*A basic dev container definition for using F# in a container. Includes everything you need to get up and running.* + +| Metadata | Value | +|----------|-------| +| *Contributors* | The VS Code Team | +| *Definition type* | Dockerfile | +| *Languages, platforms* | F# | + +## Usage + +[See here for information on using this definition with an existing project](../../README.md#using-a-definition). + +If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project. + +If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder. You can then start the test program from Debug panel in VS Code. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](../../LICENSE). diff --git a/containers/dotnetcore-latest-fsharp/test-project/Program.fs b/containers/dotnetcore-latest-fsharp/test-project/Program.fs new file mode 100644 index 00000000..4220a7d8 --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/test-project/Program.fs @@ -0,0 +1,15 @@ +//---------------------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. +// ---------------------------------------------------------------------------------------- + +open System + +[] +let main argv = + let from = "F# Container" + let target = "World" + let message = "Hello " + target + " from " + from + "!" + printfn "%s" message + + 0 // return an integer exit code diff --git a/containers/dotnetcore-latest-fsharp/test-project/app.fsproj b/containers/dotnetcore-latest-fsharp/test-project/app.fsproj new file mode 100644 index 00000000..172e0ce5 --- /dev/null +++ b/containers/dotnetcore-latest-fsharp/test-project/app.fsproj @@ -0,0 +1,13 @@ + + + + Exe + netcoreapp2.2 + + + + + + + + \ No newline at end of file diff --git a/containers/dotnetcore-latest/.devcontainer/Dockerfile b/containers/dotnetcore-latest/.devcontainer/Dockerfile new file mode 100644 index 00000000..92c18998 --- /dev/null +++ b/containers/dotnetcore-latest/.devcontainer/Dockerfile @@ -0,0 +1,14 @@ +#----------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE in the project root for license information. +#----------------------------------------------------------------------------------------- + +FROM mcr.microsoft.com/dotnet/core/sdk:latest + +# Install git, process tools +RUN apt-get update && apt-get -y install git procps + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* diff --git a/containers/dotnetcore-latest/.devcontainer/devcontainer.json b/containers/dotnetcore-latest/.devcontainer/devcontainer.json new file mode 100644 index 00000000..9b35c222 --- /dev/null +++ b/containers/dotnetcore-latest/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": ".C# (.NET Core Latest)", + "dockerFile": "Dockerfile", + "appPort": 8090, + "extensions": [ + "ms-vscode.csharp" + ] +} \ No newline at end of file diff --git a/containers/dotnetcore-latest/.npmignore b/containers/dotnetcore-latest/.npmignore new file mode 100644 index 00000000..1d72d293 --- /dev/null +++ b/containers/dotnetcore-latest/.npmignore @@ -0,0 +1,4 @@ +README.md +test-project +.vscode +.npmignore diff --git a/containers/dotnetcore-latest/.vscode/launch.json b/containers/dotnetcore-latest/.vscode/launch.json new file mode 100644 index 00000000..2945c89d --- /dev/null +++ b/containers/dotnetcore-latest/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "program": "dotnet", + "args": ["run"], + "cwd": "${workspaceFolder}/test-project", + } + ] +} \ No newline at end of file diff --git a/containers/dotnetcore-latest/.vscode/settings.json b/containers/dotnetcore-latest/.vscode/settings.json new file mode 100644 index 00000000..02264bf9 --- /dev/null +++ b/containers/dotnetcore-latest/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "razor.disabled": true +} diff --git a/containers/dotnetcore-latest/README.md b/containers/dotnetcore-latest/README.md new file mode 100644 index 00000000..408603ba --- /dev/null +++ b/containers/dotnetcore-latest/README.md @@ -0,0 +1,25 @@ +# C# (.NET Core 2.1) + +## Summary + +*A basic dev container definition for developing .NET Core applications in a container. Includes everything you need to get up and running.* + +| Metadata | Value | +|----------|-------| +| *Contributors* | The VS Code Team | +| *Definition type* | Dockerfile | +| *Languages, platforms* | .NET Core | + +## Usage + +[See here for information on using this definition with an existing project](../../README.md#using-a-definition). + +If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project. + +If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder. You can then start the test program from Debug panel in VS Code. + +## License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Licensed under the MIT License. See [LICENSE](../../LICENSE). diff --git a/containers/dotnetcore-latest/test-project/Program.cs b/containers/dotnetcore-latest/test-project/Program.cs new file mode 100644 index 00000000..07b2a4d1 --- /dev/null +++ b/containers/dotnetcore-latest/test-project/Program.cs @@ -0,0 +1,32 @@ +/*---------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See LICENSE in the project root for license information. + *---------------------------------------------------------------------------------------*/ + +using System; +using System.Linq; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Builder; +using Newtonsoft.Json; +using Microsoft.AspNetCore.Http; +using System.IO; + +namespace aspnetapp +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseUrls("http://0.0.0.0:8090") + .Configure(app => app.Run(async context => { + await context.Response.WriteAsync("Hello remote world from ASP.NET Core!"); + })) + .Build(); + + host.Run(); + } + + } +} \ No newline at end of file diff --git a/containers/dotnetcore-latest/test-project/aspnetapp.csproj b/containers/dotnetcore-latest/test-project/aspnetapp.csproj new file mode 100644 index 00000000..438c4602 --- /dev/null +++ b/containers/dotnetcore-latest/test-project/aspnetapp.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp2.1 + 31051026529000467138 + + + + + + + \ No newline at end of file