mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-23 18:39:26 +08:00
c7fa0f1b5d
Visual Studio 2017 and 2019 support debugging Docker containers. You need to install Docker for Windows for this to work, though, find it here: https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe. This change adds a Docker container definition and the settings for Visual Studio to expose the containerized Aggregation server running on Linux through the default OPC UA port (62530).
26 lines
1.1 KiB
Docker
26 lines
1.1 KiB
Docker
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
|
|
|
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
|
|
WORKDIR /app
|
|
|
|
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
|
|
WORKDIR /src
|
|
COPY ["ConsoleAggregationServer/ConsoleAggregationServer.csproj", "ConsoleAggregationServer/"]
|
|
COPY ["../../SDK/Opc.Ua.Server/Opc.Ua.Server.csproj", "../../SDK/Opc.Ua.Server/"]
|
|
COPY ["../../../Stack/Opc.Ua.Core/Opc.Ua.Core.csproj", "../../../Stack/Opc.Ua.Core/"]
|
|
COPY ["../../SDK/Opc.Ua.Configuration/Opc.Ua.Configuration.csproj", "../../SDK/Opc.Ua.Configuration/"]
|
|
COPY ["../../SDK/Opc.Ua.Client/Opc.Ua.Client.csproj", "../../SDK/Opc.Ua.Client/"]
|
|
RUN dotnet restore "ConsoleAggregationServer/ConsoleAggregationServer.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/ConsoleAggregationServer"
|
|
RUN dotnet build "ConsoleAggregationServer.csproj" -c Release -o /app/build
|
|
|
|
FROM build AS publish
|
|
RUN dotnet publish "ConsoleAggregationServer.csproj" -c Release -o /app/publish
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
EXPOSE 62530
|
|
ENTRYPOINT ["dotnet", "ConsoleAggregationServer.dll"]
|