Receiving the dllNotFound error while executing the C# Solution in linux/mac/docker environment – kernel32.dll

Need to containerize the Solution Build on Microsoft Information Protection SDK 1.6 in linux Container Architecture. Always receiving common error of dllNotFound.

Error Received while executing MIP Initialization: MIP.Initialize(MipComponent.File);

Unable to load shared library 'kernel32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libkernel32.dll: cannot open shared object file: No such file or directory
   at Microsoft.InformationProtection.Utils.UnsafeKernel32NativeMethods.LoadLibrary(String dllToLoad)
   at Microsoft.InformationProtection.Utils.Loader.LoadDlls(String dllFolder, String dllName, String[] dllDependencies)
   at Microsoft.InformationProtection.MIP.Initialize(MipComponent mipComponent, String path)
   at MIPSolution.Program.Main(String[] args) in /src/Program.cs:line 55

Dockerfile to Execute the Application:

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

RUN apt-get update 
    && apt-get install -y --allow-unauthenticated 
        libc6-dev 
        libgdiplus 
        libx11-dev 
     && rm -rf /var/lib/apt/lists/*

WORKDIR /src
COPY ["MIPSolution.csproj", "./"]
RUN dotnet restore "MIPSolution.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "MIPSolution.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MIPSolution.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# RUN dotnet --info
RUN echo "Build number: $buildno"
ENTRYPOINT ["dotnet", "MIPSolution.dll"]

All suggestions to make this application working will be very helpful.

Thanks

Source: StackOverflow