1

需要在 linux 容器架构中容器化基于 Microsoft 信息保护 SDK 1.6 构建的解决方案。总是收到 dllNotFound 的常见错误。

执行 MIP 初始化时收到错误: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 执行应用程序:

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"]

使此应用程序正常工作的所有建议都将非常有帮助。

谢谢

4

0 回答 0