Created
February 22, 2019 20:59
-
-
Save aniongithub/191d5134a74b2adf4a0a59732583c10c to your computer and use it in GitHub Desktop.
Debugging with Docker and VS Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# This is a minimal sample, but I will want to pass args and env files to the build command | |
docker build -t dockerdebug:latest . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.2</TargetFramework> | |
</PropertyGroup> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM microsoft/dotnet:sdk | |
COPY . /source | |
WORKDIR /bin | |
RUN dotnet build /source/dockerdebug.csproj -o /app | |
WORKDIR /app | |
CMD ["dotnet", "dockerdebug.dll"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// 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": "Docker: Launch .NET Core (Preview)", | |
"type": "docker-coreclr", | |
"request": "launch", | |
"preLaunchTask": "build", | |
"dockerBuild": { }, // What do I put in here? | |
"dockerRun": { }, // What do I put in here? | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace dockerdebug | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Hello World! <Press any key to exit>"); | |
Console.ReadKey(false); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# This is a minimal sample, but I will want to pass more args to this run command | |
docker run --rm -it dockerdebug:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment