Closed AdnanCukur closed 6 years ago
As a workaround, you could install NodeJS into your image by adding this to your dockerfile.
ENV NODE_VERSION 6.11.3
ENV NODE_DOWNLOAD_URL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz
ENV NODE_DOWNLOAD_SHA 610705D45EB2846A9E10690678A078D9159E5F941487ACA20C6F53B33104358C
RUN curl -SL "$NODE_DOWNLOAD_URL" --output nodejs.tar.gz \
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
&& rm nodejs.tar.gz \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
We discussed as a team. This isn't something we are planning to change. Although we don't have a good way to measure this, we suspect that most users do not need NodeJS in the runtime image. We want to keep our images slim, and we don't believe it is overly difficult for a user to add NodeJS on their own into the runtime image. (See previous comment). We'll work on adding this to our samples. See https://github.com/aspnet/Docs/issues/5450
@natemcmaster I understand you want to keep images slim as possible. But who does front end development without node pipeline of some sort?
At least there should be some official documentation pointing to the right direction. IMHO.
@andreujuanc our docs are open source and we'd be happy to take contributions to address this gap. See ongoing discussion here: https://github.com/aspnet/Docs/issues/5450
So i can't use the lighter aspnetcore image for my website because I render parts of the javascript on the serverside with Javascriptservices and aspnet-prerendering. Right now I am forced to use the aspnetcore-build as my runtime image since it contains nodejs.
Steps to reproduce the issue
Expected behavior
Site can render javascript with node
Actual behavior
Site crashes