When generating a new dotnet web application (on the command line or using visual studio), the resulting code will (not surprisingly) depend on nodejs/npm for the front-end. This is not included in the dotnet base image.
Omair, Severin, your thoughts?
What's the precise reproducer? What's the use case? I'm trying to understand what the actual problem here is. My understanding was that https://github.com/redhat-developer/s2i-dotnetcore-ex is a generated web app. The above example builds fine into an image using our builder image.
(In reply to Severin Gehwolf from comment #2) > What's the precise reproducer? What's the use case? I'm trying to understand > what the actual problem here is. 1. dotnet new -l c# -t web 2. dotnet restore 3. dotnet publish The last step shows: Publishing hello-world for .NETCoreApp,Version=v1.1 No executable found matching command "npm" So, there's an actual dependency on the `npm` tool. Do we even have this available in RHEL? Or would supporting this mean packaging npm and other tools.
The s2i-nodejs-container Dockerfile has some npm stuff in it: https://github.com/sclorg/s2i-nodejs-container/blob/master/4/Dockerfile.rhel7
(In reply to Omair Majid from comment #3) > The last step shows: > > Publishing hello-world for .NETCoreApp,Version=v1.1 > No executable found matching command "npm" The dependency seems to be "dotnet publish" specific. This works: $ cat test.in mkdir hello-world cd hello-world dotnet new -l 'c#' -t web dotnet restore dotnet run $ sudo docker run -i dotnet/dotnetcore-11-rhel7 /bin/bash < test.in This doesn't: $ cat test.in mkdir hello-world cd hello-world dotnet new -l 'c#' -t web dotnet restore dotnet publish I wonder if https://github.com/redhat-developer/s2i-dotnetcore/pull/30 breaks running the web sample app: https://github.com/redhat-developer/s2i-dotnetcore-ex > So, there's an actual dependency on the `npm` tool. Do we even have this > available in RHEL? Or would supporting this mean packaging npm and other > tools. We'd have to add nodejs collection packages (rebuild in our namespace) or depend on that collection.
project.json has some publish related tasks: ``` "scripts": { "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ] ``` bower will fetch some front end libraries (bower.json): ``` "dependencies": { "bootstrap": "3.3.6", "jquery": "2.2.3", "jquery-validation": "1.15.0", "jquery-validation-unobtrusive": "3.2.6" } ``` gulp will minify the javascript, css (gulpfile.js): ``` gulp.task("min", ["min:js", "min:css"]); ``` The `dotnet run` version is working because it is pulling those files of a CDN. The publish is doing those steps which you only do once for the production version (and which would waste your time during development).
Sounds like this, then: https://github.com/redhat-developer/s2i-dotnetcore-ex/issues/7
As an interim, I'd still suggest keep using "dotnet build" over "dotnet publish" in the default image assemble script. It has no chance of working anyway at this moment.
Note: nodejs v6 release schedule, please see rhscl 2.4 in Product Pages. nodejs v4 is released.
npm added to s2i-dotnetcore: https://github.com/redhat-developer/s2i-dotnetcore/pull/35
Testsuite passed for both 1.0.4 and 1.1.1 1.0.4 https://bugzilla.redhat.com/show_bug.cgi?id=1430300#c4 1.1.1 https://bugzilla.redhat.com/show_bug.cgi?id=1430310#c4
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:0560