.NET核心&x2B;Docker Alpine+;JsReport Local:没有这样的文件或目录

.NET核心&x2B;Docker Alpine+;JsReport Local:没有这样的文件或目录,docker,.net-core,alpine,jsreport,Docker,.net Core,Alpine,Jsreport,我正在尝试在Docker Alpine映像上使用.NET Core运行JsReport 我认为问题与“黑客”有关 有人能帮我把它翻译成阿尔卑斯命令吗 遵循我的当前配置和stacktrace Startup.cs services.AddJsReport(new LocalReporting() .UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?

我正在尝试在Docker Alpine映像上使用.NET Core运行JsReport

我认为问题与“黑客”有关

有人能帮我把它翻译成阿尔卑斯命令吗

遵循我的当前配置和stacktrace

Startup.cs

services.AddJsReport(new LocalReporting()
                    .UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
                                        jsreport.Binary.JsReportBinary.GetBinary() :
                                        jsreport.Binary.Linux.JsReportBinary.GetBinary())
                    .KillRunningJsReportProcesses()
                    .AsUtility()
                    .Create());
控制器

[HttpGet("generate/{uid}"), Route("generate")]
[MiddlewareFilter(typeof(JsReportPipeline))]
public IActionResult GenerateReport([FromQuery] Guid uid)
{
   ReportResponseModel model = _reportHelper.Get(uid);

   HttpContext.JsReportFeature().Recipe(Recipe.ChromePdf)
   .Configure(c => c.Template.Chrome = new Chrome
   {
      Landscape = model.Landscape
   });

   return View(model.ViewName, model.ViewModel);
}
Dockerfile

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine AS base
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
RUN apk add --update tzdata
ENV TZ=America/Sao_Paulo
WORKDIR /app
EXPOSE 80
EXPOSE 443

堆栈跟踪

System.ComponentModel.Win32Exception (2): No such file or directory
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at jsreport.Local.Internal.BinaryProcess.InnerExecute(String cmd, Boolean waitForExit)
at jsreport.Local.Internal.BinaryProcess.ExecuteExe(String cmd, Boolean waitForExit)
at jsreport.Local.Internal.LocalUtilityReportingService.RenderAsync(String requestString, CancellationToken ct)
at jsreport.AspNetCore.JsReportMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
 End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
System.ComponentModel.Win32Exception(2):没有这样的文件或目录
在System.Diagnostics.Process.ForkAndExecProcess(字符串文件名、字符串[]argv、字符串[]envp、字符串cwd、布尔重定向stdin、布尔重定向stdout、布尔重定向stderr、布尔设置凭据、UInt32用户ID、UInt32 groupId、UInt32[]组、Int32&stdinFd、Int32&stderrFd、布尔usesTerminal、布尔throwOnNoExec)
在System.Diagnostics.Process.StartCore(ProcessStartInfo-startInfo)
在System.Diagnostics.Process.Start()中
位于jsreport.Local.Internal.BinaryProcess.InnerExecute(字符串cmd,布尔waitForExit)
在jsreport.Local.Internal.BinaryProcess.ExecuteExe(字符串cmd,布尔waitForExit)
位于jsreport.Local.Internal.LocalUtilityReportingService.RenderAsync(String requestString,CancellationToken ct)
位于jsreport.AspNetCore.JsReportMiddleware.Invoke(HttpContext上下文)
在Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g_|24_0(ResourceInvoker invoker、Task lastTask、State next、Scope Scope、Object State、Boolean isCompleted)
位于Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed上下文)
位于Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(状态和下一步、范围和范围、对象和状态、布尔值和isCompleted)
在Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()中
来自引发异常的上一个位置的堆栈结束跟踪---
在Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g|u记录| 17|u 1(ResourceInvoker invoker)
位于Microsoft.AspNetCore.Routing.EndpointMiddleware.g_uwaitRequestTask | 6_0(端点、任务请求任务、ILogger记录器)
在Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext上下文)中
位于Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext上下文)
在Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext上下文)中
在Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g|u waiting|6|0(ExceptionHandlerMiddleware中间件,HttpContext上下文,任务任务)
问题在于未在alpine上编译的保留。也许它只是缺少了一些依赖项,导致
没有这样的文件或目录
,但我无法找出是哪个。也许,我们需要在alpine上重新编译二进制文件,并将其嵌入另一个
jsreport.binary.Linux.alpine
nuget

可以考虑在另一个容器中运行完整的JSRead,并使用例如DOCKER撰写将容器链接在一起。这是一个演示