-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.windows
46 lines (41 loc) · 1.46 KB
/
Dockerfile.windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as dotnet-sdk
WORKDIR /downloads
ADD https://download.visualstudio.microsoft.com/download/pr/`
adeab8b1-1c44-41b2-b12a-156442f307e9/65ebf805366410c63edeb06e53959383`
/dotnet-sdk-3.1.201-win-x64.zip dotnet-sdk.zip
RUN powershell Expand-Archive`
-Path dotnet-sdk.zip`
-DestinationPath C:\dotnet
USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\dotnet"
RUN setx /M DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
RUN setx /M DOTNET_CLI_TELEMETRY_OPTOUT 0
USER ContainerUser
RUN dotnet --list-sdks
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as dotnet
WORKDIR /downloads
ADD https://download.visualstudio.microsoft.com/download/pr/`
f6387d06-5958-4935-ba28-183bb1f8ec7f/a9ccb4d10faec396135e6b967b7037da/`
dotnet-runtime-3.1.3-win-x64.zip dotnet-runtime.zip
RUN powershell Expand-Archive`
-Path dotnet-runtime.zip`
-DestinationPath C:\dotnet
USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\dotnet"
USER ContainerUser
RUN dotnet --list-runtimes
FROM dotnet-sdk AS build
WORKDIR /src
COPY "HtmlToPdf.Console" .
RUN dotnet clean "HtmlToPdf.Console.csproj" --nologo
RUN dotnet restore "HtmlToPdf.Console.csproj"
RUN dotnet build "HtmlToPdf.Console.csproj" -c Release -o /app/build
FROM build AS publish
WORKDIR /src
RUN dotnet publish "HtmlToPdf.Console.csproj" -c Release -o /app/publish
FROM dotnet AS final
WORKDIR /app
VOLUME "C:\pdf-result"
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "HtmlToPdf.Console.dll"]