Skip to content

Commit d76fefb

Browse files
committed
929846 Changed the Docker section of HTML to PDF sample
1 parent ea8b882 commit d76fefb

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Docker/HTML_to_PDF_docker/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
22

3-
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
3+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
44
RUN apt-get update && \
55
apt-get install -yq --no-install-recommends \
66
libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
@@ -9,10 +9,12 @@ RUN apt-get update && \
99
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
1010
libnss3 libgbm1
1111
WORKDIR /app
12+
13+
1214
EXPOSE 80
1315
EXPOSE 443
1416

15-
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
17+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
1618
WORKDIR /src
1719
COPY ["HTML_to_PDF_docker/HTML_to_PDF_docker.csproj", "HTML_to_PDF_docker/"]
1820
RUN dotnet restore "HTML_to_PDF_docker/HTML_to_PDF_docker.csproj"
@@ -22,6 +24,9 @@ RUN dotnet build "HTML_to_PDF_docker.csproj" -c Release -o /app/build
2224

2325
FROM build AS publish
2426
RUN dotnet publish "HTML_to_PDF_docker.csproj" -c Release -o /app/publish
27+
RUN chmod +x /app/runtimes/linux/native/chrome && \
28+
chmod +x /app/runtimes/linux/native/chrome-wrapper
29+
2530

2631
FROM base AS final
2732
WORKDIR /app

Docker/HTML_to_PDF_docker/HTML_to_PDF_docker.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<UserSecretsId>6c7f4163-1d66-435b-ab83-6a6f99a7006c</UserSecretsId>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
10+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
1111
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Linux" Version="*" />
1212
</ItemGroup>
1313

0 commit comments

Comments
 (0)