首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法启动节点的码头ASP.NET核心项目w/ JavaScriptServices

无法启动节点的码头ASP.NET核心项目w/ JavaScriptServices
EN

Stack Overflow用户
提问于 2017-11-17 15:17:50
回答 1查看 448关注 0票数 1

我有问题,以获得一个网站,以正确运行在一个码头集装箱。容器构建良好并运行,但是当导航到页面时,它在加载JavaScript服务时失败。

这是Dockerfile

代码语言:javascript
复制
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运行,所以节点被安装在我所知的范围内。

失败请求的输出是-

代码语言:javascript
复制
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找到节点设置一条新路径的问题吗?如果是的话,你知道码头应该走什么路吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-17 15:58:21

我想我忽略了运行时映像库容器。

变成了FROM microsoft/aspnetcore-build:2.0,现在我没事了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47353885

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档