11# escape=`
22
3- # docker build . -f docker/win-x64.Dockerfile -t aggregator:win-x64 --build-arg MAJOR_MINOR_PATCH=1.2.3 --build-arg PRERELEASE_TAG=beta-test-42
4- FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
3+ # Sample build
4+ # docker build . -f docker/win-x64.Dockerfile -t aggregator:win-x64 --build-arg MAJOR_MINOR_PATCH=1.2.3 --build-arg PRERELEASE_TAG=beta-test-42
5+ # see tags at https://hub.docker.com/_/microsoft-dotnet-sdk/
6+ FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
57
68ARG MAJOR_MINOR_PATCH=0.0.0
79ARG PRERELEASE_TAG=
810ARG CONFIGURATION=Release
9- ARG FRAMEWORK=netcoreapp3.1
11+ ARG FRAMEWORK=net6.0
1012ARG RUNTIME_IDENTIFIER=win-x64
1113
1214SHELL ["pwsh" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
@@ -17,16 +19,17 @@ COPY ./src /workspace/src
1719WORKDIR /workspace
1820
1921RUN dotnet restore src/aggregator-host/aggregator-host.csproj
20- RUN dotnet build -f $env:FRAMEWORK -r $env:RUNTIME_IDENTIFIER -c $env:CONFIGURATION -o build src/aggregator-host/aggregator-host.csproj /p:VersionPrefix=$env:MAJOR_MINOR_PATCH /p:VersionSuffix=$env:PRERELEASE_TAG
22+ RUN dotnet build -f $env:FRAMEWORK -r $env:RUNTIME_IDENTIFIER -c $env:CONFIGURATION -o build --no-self-contained src/aggregator-host/aggregator-host.csproj /p:VersionPrefix=$env:MAJOR_MINOR_PATCH /p:VersionSuffix=$env:PRERELEASE_TAG
2123RUN dotnet test --configuration $env:CONFIGURATION src/unittests-core/unittests-core.csproj `
2224 && dotnet test --configuration $env:CONFIGURATION src/unittests-ruleng/unittests-ruleng.csproj
2325
24- RUN dotnet publish --no-restore -f $env:FRAMEWORK -r $env:RUNTIME_IDENTIFIER -c $env:CONFIGURATION -o out src/aggregator-host/aggregator-host.csproj -p:VersionPrefix=$env:MAJOR_MINOR_PATCH -p:VersionSuffix=$env:PRERELEASE_TAG
26+ RUN dotnet publish --no-restore -f $env:FRAMEWORK -r $env:RUNTIME_IDENTIFIER -c $env:CONFIGURATION -o out --no-self-contained src/aggregator-host/aggregator-host.csproj -p:VersionPrefix=$env:MAJOR_MINOR_PATCH -p:VersionSuffix=$env:PRERELEASE_TAG
2527
2628
29+ # see tags at https://hub.docker.com/_/microsoft-dotnet-aspnet/
2730# 1809 should guarantee compatibility from Server 2019 up
2831# note that Server 2016 is unsupported https://github.com/dotnet/dotnet-docker/issues/1469
29- FROM mcr.microsoft.com/dotnet/core/ aspnet:3.1 -nanoserver-1809 AS final
32+ FROM mcr.microsoft.com/dotnet/aspnet:6.0 -nanoserver-1809 AS final
3033
3134WORKDIR /app
3235
0 commit comments