Working example using Visual Studio 2017 and docker? #929

Closed
opened 2025-08-09 17:18:13 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @fbeltrao on 3/16/2017

Hi there,

I am struggling trying to run the template application inside Docker.
Looks to me that JavaScriptServices can't find nodejs on the docker image microsoft/aspnetcore:1.1

I get the error "An exception of type 'System.AggregateException' occurred in System.Private.CoreLib.ni.dll but was not handled in user code"

I tried to modify the Dockerfile adding nodejs the following way:
FROM microsoft/aspnetcore:1.1
RUN apt-get update
RUN apt-get -qq update
RUN apt-get install -y nodejs npm
#debian installs node as nodejs
RUN update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "MyApp.dll"]

Still without success.

Using the following dockerfile works (because the docker image has nodejs installed):
FROM microsoft/aspnetcore-build
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "MyApp.dll"]

I just think it is overkill to have this 1.19GB image (compared to 268 MB from aspnetcore) just to run the aspnetcore + nodejs.

Would it be possible to create a sample application where Docker is working?

*Originally created by @fbeltrao on 3/16/2017* Hi there, I am struggling trying to run the template application inside Docker. Looks to me that JavaScriptServices can't find nodejs on the docker image microsoft/aspnetcore:1.1 I get the error "An exception of type 'System.AggregateException' occurred in System.Private.CoreLib.ni.dll but was not handled in user code" I tried to modify the Dockerfile adding nodejs the following way: FROM microsoft/aspnetcore:1.1 RUN apt-get update RUN apt-get -qq update RUN apt-get install -y nodejs npm #debian installs `node` as `nodejs` RUN update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10 ARG source WORKDIR /app EXPOSE 80 COPY ${source:-obj/Docker/publish} . ENTRYPOINT ["dotnet", "MyApp.dll"] Still without success. Using the following dockerfile works (because the docker image has nodejs installed): FROM microsoft/aspnetcore-build ARG source WORKDIR /app EXPOSE 80 COPY ${source:-obj/Docker/publish} . ENTRYPOINT ["dotnet", "MyApp.dll"] I just think it is overkill to have this 1.19GB image (compared to 268 MB from aspnetcore) just to run the aspnetcore + nodejs. Would it be possible to create a sample application where Docker is working?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#929
No description provided.