Skip to content

Commit 5220a83

Browse files
committed
Updated docker compilation script for dotnet6 for windows projects DNP3, OPC-DA.
1 parent 43f42a5 commit 5220a83

File tree

3 files changed

+60
-16
lines changed

3 files changed

+60
-16
lines changed

compile-docker/Dnp3Client.csproj

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<Platforms>x64</Platforms>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
11+
<PackageReference Include="opendnp3" Version="3.1.2" />
12+
</ItemGroup>
13+
14+
</Project>

compile-docker/OPC-DA-Client.csproj

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net6.0-windows</TargetFrameworks>
4+
<LangVersion>12.0</LangVersion>
5+
<AssemblyName>OPC-DA-Client</AssemblyName>
6+
<OutputType>Exe</OutputType>
7+
<PackageId>JsonScada.OpcDaClient</PackageId>
8+
<Product>JSON-SCADA</Product>
9+
<Description>OPC-DA Client Driver</Description>
10+
<Copyright>Copyright © 2024 - Ricardo Lastra Olsen</Copyright>
11+
<Platforms>AnyCPU</Platforms>
12+
<RestoreSources>$(RestoreSources);../opcdaaehda-client-solution-net/nuget/;https://api.nuget.org/v3/index.json</RestoreSources>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<Folder Include="Properties\" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
21+
<PackageReference Include="Technosoftware.DaAeHdaSolution.DaAeHdaClient" Version="2.0.2" />
22+
</ItemGroup>
23+
24+
</Project>

compile-docker/docker-compose.yaml

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '2.1'
2-
31
# {json:scada} Docker Compilation for Linux x64 - (c) 2020-2024 - Ricardo L. Olsen
42
# Requires Internet connection!
53

@@ -47,17 +45,7 @@ services:
4745
cd /src/libiec61850/dotnet/core/2.0/IEC61850.NET.core.2.0/ &&
4846
rm -rf obj bin &&
4947
cd /src/libiec61850 &&
50-
rm -rf .install &&
51-
cd /src/OPC-DA-Client/ &&
52-
dotnet publish --self-contained --runtime win-x64 -p:PublishReadyToRun=true -f net8.0-windows -c Release -o /publish_bin_win/ OPC-DA-Client.csproj &&
53-
rm -rf obj bin &&
54-
cd /src/dnp3/Dnp3Client/ &&
55-
dotnet publish --self-contained --runtime win-x64 -p:PublishReadyToRun=true -c Release -o /publish_bin_win/ &&
56-
rm -rf obj bin &&
57-
cp Dependencies/OpenSSL/*.dll /publish_bin_win/ "
58-
59-
# NOTICE Dnp3Client is Windows-only, so it can only run in docker/linux using Wine.
60-
48+
rm -rf .install "
6149
environment:
6250
- DOTNET_CLI_TELEMETRY_OPTOUT=1
6351
#command: tail -f /dev/null
@@ -67,10 +55,28 @@ services:
6755
- ../src/OPC-UA-Client:/src/OPC-UA-Client
6856
- ../src/libplctag:/src/libplctag
6957
- ../demo-docker/bin:/publish_bin
70-
- ../src/dnp3:/src/dnp3
71-
- ../src/OPC-DA-Client:/src/OPC-DA-Client
7258
- ../src/opcdaaehda-client-solution-net:/src/opcdaaehda-client-solution-net
59+
60+
# NOTICE Dnp3Client and OPC-DA-Client are Windows-only, so it can only run in docker/linux using Wine.
61+
dotnet_compile_win:
62+
image: mcr.microsoft.com/dotnet/sdk:6.0
63+
container_name: js_dotnet_compile
64+
command: sh -c "cd /src/OPC-DA-Client/ &&
65+
dotnet publish --self-contained --runtime win-x64 -p:PublishReadyToRun=false -f net6.0-windows -c Release -o /publish_bin_win/ OPC-DA-Client.csproj &&
66+
rm -rf obj bin &&
67+
cd /src/dnp3/Dnp3Client/ &&
68+
dotnet publish --self-contained --runtime win-x64 -p:PublishReadyToRun=false -c Release -o /publish_bin_win/ Dnp3Client.csproj &&
69+
rm -rf obj bin &&
70+
cp Dependencies/OpenSSL/*.dll /publish_bin_win/ "
71+
environment:
72+
- DOTNET_CLI_TELEMETRY_OPTOUT=1
73+
#command: tail -f /dev/null
74+
volumes:
7375
- ../demo-docker/bin_win:/publish_bin_win
76+
- ../src/dnp3:/src/dnp3
77+
- ./Dnp3Client.csproj:/src/dnp3/Dnp3Client/Dnp3Client.csproj
78+
- ../src/OPC-DA-Client:/src/OPC-DA-Client
79+
- ./OPC-DA-Client.csproj:/src/OPC-DA-Client/OPC-DA-Client.csproj
7480

7581
calculations_compile:
7682
image: golang:alpine
@@ -189,6 +195,6 @@ services:
189195
mqtt_sparkplug_update:
190196
image: node:20-alpine
191197
container_name: js_mqtt_sparkplug_update
192-
command: sh -c "apk add --update npm && npm install -g npm && cd /mqtt-sparkplug && npm install && chmod -R 777 node_modules"
198+
command: sh -c "apk add --update npm && npm install -g npm && cd /mqtt-sparkplug && npm install"
193199
volumes:
194200
- ../src/mqtt-sparkplug:/mqtt-sparkplug

0 commit comments

Comments
 (0)