2017-11-17 10 views
1

ドッキング用のコンテナの内部で正しく動作するサイトを取得する際に問題が発生しています。コンテナはうまく構築されて実行されますが、ページに移動するとJavaScriptサービスのロードに失敗します。DockerのJavaScriptServicesを使用したASP.NETコアプロジェクト

はここ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が実行さありません。

失敗した要求の出力がある - これは、ノードを見つけるために、ASP.NETの新しいパスを設定する事

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 

Full Error Stack @ Pastebin

ですか?もしそうなら、その道がDockerにあるべきであるという考えはありますか?

答えて

0

私はランタイムイメージベースコンテナを見落としたと思います。

FROM microsoft/aspnetcore-build:2.0に変更されました。

関連する問題