Skip to content

Commit ed398d3

Browse files
part 5 - dotnet
1 parent 0e2ad9f commit ed398d3

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"name": ".NET Core Docker Attach",
9+
"type": "coreclr",
10+
"request": "attach",
11+
"processId": "${command:pickRemoteProcess}",
12+
"pipeTransport": {
13+
"pipeProgram": "docker",
14+
"pipeArgs": [ "exec", "-i", "csharp" ],
15+
"debuggerPath": "/root/vsdbg/vsdbg",
16+
"pipeCwd": "${workspaceRoot}",
17+
"quoteArgs": false
18+
},
19+
"sourceFileMap": {
20+
"/work": "${workspaceRoot}/c#/src/"
21+
}
22+
},
723
{
824
"name": "Remote Docker",
925
"type": "go",

c#/dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch as dev
1+
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch as debug
2+
3+
#install debugger for NET Core
4+
RUN apt-get update
5+
RUN apt-get install -y unzip
6+
RUN curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -l ~/vsdbg
27

38
RUN mkdir /work/
49
WORKDIR /work/
@@ -10,7 +15,7 @@ COPY ./src/ /work/
1015
RUN mkdir /out/
1116
RUN dotnet publish --no-restore --output /out/ --configuration Release
1217

13-
18+
CMD dotnet run
1419
###########START NEW IMAGE###########################################
1520

1621
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim as prod

docker-compose.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ services:
55
image: aimvector/csharp:1.0.0
66
build:
77
context: ./c#
8-
target: prod
9-
#working_dir: /work #comment out for build.target:prod
10-
#entrypoint: /bin/sh #comment out for build.target:prod
11-
#stdin_open: true #comment out for build.target:prod
12-
#tty: true #comment out for build.target:prod
8+
target: debug
139
volumes:
1410
- ./c#/src/:/work/
1511
ports:

0 commit comments

Comments
 (0)