在Docker中有JavaScriptServices的ASP.NET Core Project无法启动节点
我有问题得到一个站点在docker集装箱内正常运行。 容器生成正常并且运行,但是当浏览到页面时,它加载JavaScript服务失败。
这是Dockerfile
FROM microsoft/aspnetcore-build:2.0 AS builder WORKDIR /app ADD company_cas.pem /usr/local/share/ca-certificates/company_cas.crt RUN update-ca-certificates COPY company_cas.pem ./ RUN npm config set cafile company_cas.pem # Run NPM install for dependencies COPY package.json ./ RUN npm install # Copy csproj and restore as distinct layers COPY *.csproj ./ RUN dotnet restore # Copy everything else and build COPY . ./ RUN dotnet publish -c Release -o out # Build runtime image FROM microsoft/aspnetcore:2.0 WORKDIR /app COPY --from=builder /app/out . ENTRYPOINT ["dotnet", "web.dll"]
我正在使用microsoft/aspnetcore-build:2.0
基本映像,并且npm确实运行,所以Node被安装到我所知道的最好的。
失败的请求的输出是 –
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0] web | An unhandled exception has occurred: Failed to start Node process. To resolve this:. web | web | [1] Ensure that Node.js is installed and can be found in one of the PATH directories. web | Current PATH enviroment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin web | Make sure the Node executable is in one of those directories, or update your PATH. web | web | [2] See the InnerException for further details of the cause. web | System.InvalidOperationException: Failed to start Node process. To resolve this:. web | web | [1] Ensure that Node.js is installed and can be found in one of the PATH directories. web | Current PATH enviroment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin web | Make sure the Node executable is in one of those directories, or update your PATH. web | web | [2] See the InnerException for further details of the cause. ---> System.ComponentModel.Win32Exception: No such file or directory
完整的错误堆栈@ Pastebin
这是为ASP.NET设置一个新的PATHfind节点的问题? 如果是这样,那么Docker中的path应该是什么?
我想我忽略了运行时的图像库容器。
更改为FROM microsoft/aspnetcore-build:2.0
,现在我很好。
- 如何configurationDocker的mysql + aspnet
- 在作为自定义用户运行的Docker中运行ASP.NET Core应用程序
- 处理“HTTP请求超时。 退出“。为Docker构build一个大型的aspnet项目
- 如何启用Docker容器的出站连接?
- 在Windows上的Docker从dotnetcore应用程序连接到SQL服务器
- 不能build立官方的asp.net泊坞窗图像
- 在Docker中,我可以允许IIS在运行MVC项目的容器中输出详细的错误吗?
- 如何将Docker镜像从Docker Hub部署到Azure ACS?
- 与Docker的Asp.Net核心 – 包括重复的“内容”项目