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 AS base

FROM AS build

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

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
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.


Source: StackOverflow