我在为Raspberry Pi 3 Model B +建立有效的ASP .NET Core映像时遇到麻烦。每当我尝试运行该应用程序时,我都会收到错误消息:
standard_init_linux.go:190:exec用户进程导致“ exec格式错误”
但是,当我尝试使用Github(docker run --rm microsoft/dotnet-samples
)的预构建.NET Core Docker映像时,一切正常。
当我简单地下载相同的回购和建设所提供的相同的代码Dockerfile用docker build . -t aspnettest-f Dockerfile
它推到Raspberrry,并得到了同样的错误之前:
我究竟做错了什么?我试过建设有不同的规定Dockerfiles像示例代码这一个,但所有导致同样的错误。
如果在Windows下构建映像FROM microsoft/dotnet:2.1-runtime AS runtime
,FROM microsoft/dotnet:2.1-runtime-stretch-slim-arm32v7 AS runtime
则在Dockerfile中需要替换为。
构建ASP.NET Core App时,ARM32的运行时映像为microsoft/dotnet:2.1-aspnetcore-runtime-stretch-slim-arm32v7
。
在Raspberry上构建图像应该可以正常工作。
这是因为microsoft/dotnet:2.1-runtime
是多docker build
体系结构,并且选择了与当前处理器体系结构匹配的映像。因此,在Windows下构建时,生成的图像将用于amd64。
更新:
现在,我们可以使用Microsoft容器注册表中的这些图像:
.NET Core 2.2:
mcr.microsoft.com/dotnet/core/runtime:2.2-stretch-slim-arm32v7
mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim-arm32v7
.NET Core 3.1:
mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7
mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim-arm32v7
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句