Skip to content

Commit 8ddcbff

Browse files
Merge pull request #206 from DharanitharanA/main
Updated Word to PDF docker sample to .NET80
2 parents 0753d20 + 465bb59 commit 8ddcbff

File tree

102 files changed

+75217
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+75217
-177
lines changed

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/Alpine/WordToPDFDockerSample/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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-alpine3.12 AS base
3+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
44
RUN apk update && apk upgrade && apk add fontconfig
55
RUN apk add --update ttf-dejavu fontconfig
66
WORKDIR /app
77

8-
FROM mcr.microsoft.com/dotnet/sdk:3.1-alpine3.12 AS build
8+
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
99
WORKDIR /src
1010
COPY ["WordToPDFDockerSample.csproj", "."]
1111
RUN dotnet restore "./WordToPDFDockerSample.csproj"

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/Alpine/WordToPDFDockerSample/WordToPDFDockerSample.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
<DockerfileContext>.</DockerfileContext>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
12-
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2" />
13-
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="19.2.0.55" />
11+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
12+
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
13+
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="*" />
1414
</ItemGroup>
1515

1616
</Project>
Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
1-
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
1+
# Use the official .NET 8.0 SDK image from Microsoft for building the application
2+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
3+
RUN apt-get update -y && apt-get install libfontconfig -y
4+
WORKDIR /src
25

6+
# Copy the project file and restore dependencies
7+
COPY ["WordToPDFDockerSample.csproj", "."]
8+
RUN dotnet restore "WordToPDFDockerSample.csproj"
9+
10+
# Copy the rest of the application code and build the application
11+
COPY . .
12+
RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build
13+
14+
# Publish the application
15+
FROM build AS publish
16+
RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish /p:UseAppHost=false
17+
18+
# Use CentOS 8 as the base image for the final runtime
319
FROM centos:8
420

5-
Run dnf install dotnet-sdk-3.1 -y
6-
RUN dnf install dotnet-runtime-3.1 -y
21+
# Install .NET 8.0 runtime
22+
RUN dnf install -y https://packages.microsoft.com/config/centos/8/prod.repo \
23+
&& dnf install -y dotnet-runtime-8.0 \
24+
&& dnf clean all
25+
26+
# Install fontconfig for fonts
27+
RUN dnf install -y fontconfig
28+
29+
# Set the working directory
30+
WORKDIR /app
731

8-
RUN dnf install fontconfig -y
32+
# Copy the published application from the previous stage
33+
COPY --from=publish /app/publish .
934

10-
ENTRYPOINT ["dotnet" "WordToPDFDockerSample.dll"]
35+
# Set the entry point for the container
36+
ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"]

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/CentOS/WordToPDFDockerSample/WordToPDFDockerSample.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
<DockerfileContext>.</DockerfileContext>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
12-
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2" />
13-
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="19.2.0.55" />
12+
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
13+
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="*" />
1414
</ItemGroup>
1515

1616
</Project>

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/Debian/WordToPDFDockerSample/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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-buster-slim AS base
3+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-buster-slim AS base
44
RUN apt-get update -y && apt-get install fontconfig -y
55
WORKDIR /app
66

7-
FROM mcr.microsoft.com/dotnet/sdk:3.1-buster-slim AS build
7+
FROM mcr.microsoft.com/dotnet/sdk:8.0-buster-slim AS build
88
WORKDIR /src
99
COPY ["WordToPDFDockerSample.csproj", "."]
1010
RUN dotnet restore "./WordToPDFDockerSample.csproj"

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/Debian/WordToPDFDockerSample/WordToPDFDockerSample.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
<DockerfileContext>.</DockerfileContext>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
12-
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2" />
13-
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="19.2.0.55" />
11+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
12+
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
13+
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="*" />
1414
</ItemGroup>
1515

1616
</Project>

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/Fedora/WordToPDFDockerSample/Dockerfile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,26 @@
22

33
FROM fedora:latest
44

5-
Run dnf install dotnet-sdk-3.1 -y
6-
RUN dnf install dotnet-runtime-3.1 -y
5+
# Install .NET 8.0 SDK and runtime
6+
Run dnf install dotnet-sdk-8.0 -y
7+
RUN dnf install dotnet-runtime-8.0 -y
78

9+
# Install fontconfig for font support
810
RUN dnf install fontconfig -y
911

10-
ENTRYPOINT ["dotnet" "WordToPDFDockerSample.dll"]
12+
# Set the working directory
13+
WORKDIR /app
14+
15+
# Copy the application files
16+
COPY ["WordToPDFDockerSample.csproj", "."]
17+
RUN dotnet restore "WordToPDFDockerSample.csproj"
18+
COPY . .
19+
20+
# Build the application
21+
RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build
22+
23+
# Publish the application
24+
RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish
25+
26+
# Set the final stage to use the runtime image
27+
ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"]

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/Fedora/WordToPDFDockerSample/WordToPDFDockerSample.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
<DockerfileContext>.</DockerfileContext>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
12-
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2" />
13-
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="19.2.0.55" />
12+
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
13+
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="*" />
1414
</ItemGroup>
1515

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

3-
FROM registry.access.redhat.com/ubi8/dotnet-31-runtime AS base
3+
FROM registry.access.redhat.com/ubi8/dotnet-80-runtime AS base
44
USER root
5-
RUN yum -y install fontconfig --disablerepo=epel
6-
WORKDIR /
5+
RUN microdnf install -y fontconfig \
6+
&& microdnf clean all
7+
WORKDIR /app
78

8-
FROM registry.access.redhat.com/ubi8/dotnet-31 AS build
9+
# Use Red Hat Universal Base Image (UBI) 8 with .NET 8.0 SDK for building the application
10+
FROM registry.access.redhat.com/ubi8/dotnet-80 AS build
911
WORKDIR /src
1012
COPY ["WordToPDFDockerSample.csproj", ""]
1113
RUN dotnet restore "./WordToPDFDockerSample.csproj"
1214
COPY . .
1315
WORKDIR "/src/."
1416
RUN dotnet build "WordToPDFDockerSample.csproj" -c Release -o /app/build
1517

18+
# Publish the application
1619
FROM build AS publish
1720
RUN dotnet publish "WordToPDFDockerSample.csproj" -c Release -o /app/publish
1821

22+
# Use the .NET 8.0 runtime to run the application
1923
FROM base AS final
2024
WORKDIR /app
2125
COPY --from=publish /app/publish .
22-
ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"]
26+
ENTRYPOINT ["dotnet", "WordToPDFDockerSample.dll"]

Word-to-PDF-Conversion/Convert-Word-document-to-PDF/Docker/RHEL/WordToPDFDockerSample/WordToPDFDockerSample.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
<DockerfileContext>.</DockerfileContext>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
12-
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2" />
13-
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="19.2.0.55" />
12+
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
13+
<PackageReference Include="Syncfusion.DocIORenderer.Net.Core" Version="*" />
1414
</ItemGroup>
1515

1616
</Project>

0 commit comments

Comments
 (0)