From ed398d3742f2ad5b4e241b09abea709b6aa52086 Mon Sep 17 00:00:00 2001 From: Marcel Dempers Date: Sun, 4 Aug 2019 21:12:53 +1000 Subject: [PATCH] part 5 - dotnet --- .vscode/launch.json | 16 ++++++++++++++++ c#/dockerfile | 9 +++++++-- docker-compose.yaml | 6 +----- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0cc4dba0d..6e79ee66b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,22 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": ".NET Core Docker Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickRemoteProcess}", + "pipeTransport": { + "pipeProgram": "docker", + "pipeArgs": [ "exec", "-i", "csharp" ], + "debuggerPath": "/root/vsdbg/vsdbg", + "pipeCwd": "${workspaceRoot}", + "quoteArgs": false + }, + "sourceFileMap": { + "/work": "${workspaceRoot}/c#/src/" + } + }, { "name": "Remote Docker", "type": "go", diff --git a/c#/dockerfile b/c#/dockerfile index 3621ce4a3..65312c33c 100644 --- a/c#/dockerfile +++ b/c#/dockerfile @@ -1,4 +1,9 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch as dev +FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch as debug + +#install debugger for NET Core +RUN apt-get update +RUN apt-get install -y unzip +RUN curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -l ~/vsdbg RUN mkdir /work/ WORKDIR /work/ @@ -10,7 +15,7 @@ COPY ./src/ /work/ RUN mkdir /out/ RUN dotnet publish --no-restore --output /out/ --configuration Release - +CMD dotnet run ###########START NEW IMAGE########################################### FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim as prod diff --git a/docker-compose.yaml b/docker-compose.yaml index 029b3fe3d..651a5c0bf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,11 +5,7 @@ services: image: aimvector/csharp:1.0.0 build: context: ./c# - target: prod - #working_dir: /work #comment out for build.target:prod - #entrypoint: /bin/sh #comment out for build.target:prod - #stdin_open: true #comment out for build.target:prod - #tty: true #comment out for build.target:prod + target: debug volumes: - ./c#/src/:/work/ ports: