Skip to content

Commit b2910ac

Browse files
author
Qingqing Sun
committed
add edge config file and docker debug file
1 parent 245ee22 commit b2910ac

File tree

5 files changed

+103
-6
lines changed

5 files changed

+103
-6
lines changed

content/dotnet-template-azure-iot-edge-module/CSharp/.template.config/template.json

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@
3333
"type": "parameter",
3434
"datatype": "bool",
3535
"defaultValue": "true"
36+
},
37+
"target": {
38+
"type": "parameter",
39+
"datatype": "choice",
40+
"defaultValue": "All",
41+
"choices": [
42+
{
43+
"choice": "All"
44+
},
45+
{
46+
"choice": "Config"
47+
}
48+
]
3649
}
3750
},
3851
"sources": [
@@ -45,23 +58,29 @@
4558
],
4659
"modifiers": [
4760
{
48-
"condition": "(windows-nano)",
61+
"condition": "(windows-nano && target != 'Config')",
4962
"include": [
50-
"Docker/windows-nano/Dockerfile"
63+
"Docker/windows-nano/*"
5164
]
5265
},
5366
{
54-
"condition": "(linux-x64)",
67+
"condition": "(linux-x64 && target != 'Config')",
5568
"include": [
56-
"Docker/linux-x64/Dockerfile"
69+
"Docker/linux-x64/*"
70+
]
71+
},
72+
{
73+
"condition": "(target == 'Config')",
74+
"exclude": [
75+
"*.cs", "*.csproj", ".gitignore"
5776
]
5877
}
5978
]
6079
}
6180
],
6281
"postActions": [
6382
{
64-
"condition": "(!skipRestore)",
83+
"condition": "(!skipRestore && target != 'Config')",
6584
"description": "Restore NuGet packages required by this project.",
6685
"manualInstructions": [
6786
{

content/dotnet-template-azure-iot-edge-module/CSharp/Docker/linux-x64/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ WORKDIR /app
66

77
COPY $EXE_DIR/ ./
88

9+
RUN apt-get update
10+
11+
RUN apt-get install -y unzip procps
12+
13+
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
14+
915
CMD ["dotnet", "SampleModule.dll"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM microsoft/dotnet:2.0.0-runtime
2+
3+
ARG EXE_DIR=.
4+
5+
WORKDIR /app
6+
7+
COPY $EXE_DIR/ ./
8+
9+
RUN apt-get update
10+
11+
RUN apt-get install -y unzip procps
12+
13+
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
14+
15+
CMD ["dotnet", "SampleModule.dll"]

content/dotnet-template-azure-iot-edge-module/CSharp/SampleModule.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.6.0-preview-003" />
13+
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.6.0-preview-004" />
1414
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0-preview2-final" />
1515
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0-preview2-final" />
1616
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.0.0-preview2-final" />
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"moduleContent": {
3+
"$edgeAgent": {
4+
"properties.desired": {
5+
"schemaVersion": "1.0",
6+
"runtime": {
7+
"type": "docker",
8+
"settings": {
9+
"minDockerVersion": "v1.25",
10+
"loggingOptions": ""
11+
}
12+
},
13+
"systemModules": {
14+
"edgeAgent": {
15+
"type": "docker",
16+
"settings": {
17+
"image": "edgepreview.azurecr.io/azureiotedge/edge-agent:1.0-preview",
18+
"createOptions": ""
19+
}
20+
},
21+
"edgeHub": {
22+
"type": "docker",
23+
"status": "running",
24+
"restartPolicy": "always",
25+
"settings": {
26+
"image": "edgepreview.azurecr.io/azureiotedge/edge-hub:1.0-preview",
27+
"createOptions": ""
28+
}
29+
}
30+
},
31+
"modules": {
32+
"SampleModule": {
33+
"version": "1.0",
34+
"type": "docker",
35+
"status": "running",
36+
"restartPolicy": "always",
37+
"settings": {
38+
"image": "<dockeruser>/<image>:<tag>",
39+
"createOptions": "{}"
40+
}
41+
}
42+
}
43+
}
44+
},
45+
"$edgeHub": {
46+
"properties.desired": {
47+
"schemaVersion": "1.0",
48+
"routes": {
49+
"route": "FROM /* INTO $upstream"
50+
},
51+
"storeAndForwardConfiguration": {
52+
"timeToLiveSecs": 10
53+
}
54+
}
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)