aspnet / aspnet-docker

[Archived] ASP.NET Core Docker images for 1.x. Go to https://github.com/dotnet/dotnet-docker for 2.1 and up.
https://asp.net
719 stars 171 forks source link

Plans to upgrade Node to version 8? #334

Closed alexvy86 closed 6 years ago

alexvy86 commented 6 years ago

Just wondering if there are there any plans to upgrade Node in the aspnetcore-build image to 8.x? I'd prefer to avoid forking the Dockerfile and modifying the part that installs node if that's already in the works somewhere.

natemcmaster commented 6 years ago

At the moment, we don't have upgrade plans. Upgrading existing images to Node 8 could be a breaking change for some users. We're also looking into whether it makes sense to include Node in our images at all. In theory, multi-stage builds makes it much easier to compose a build using both aspnetcore and nodejs images. This would free devs to select the version of node their project requires. But if we don't go this route, we'll likely include Node 8 in any new images we produce.

natemcmaster commented 6 years ago

We discussed this more as a team. We have decided not to update the NodeJS version in existing images for now. We're concerned about the breaking changes this would introduce for existing users. e.g. breaking changes between npm3 and npm5.

At the moment, we are planning on putting Node 8 in to the 2.1-preview1 images, but this might change by 2.1 RTM. Because NodeJS has its own release cycles that don't align with ASP.NET Core, we are considering instead removing NodeJS altogether. We believe multi-stage builds are the best way to allow users to independently control the version of NodeJS they want to use. See https://github.com/aspnet/aspnet-docker/issues/367

The latest builds of microsoft/aspnetcore-build-nightly:2.1 have been upgraded to NodeJS 8 (see #361), so closing for now as I don't think there is any additional action item here. (Update see below)

natemcmaster commented 6 years ago

Also, we plan to address this scenario by adding more samples to https://github.com/aspnet/Docs/issues/5450. For example, you could upgrade an existing image to NodeJS 8.9 like this:

FROM microsoft/aspnetcore-build:2.0
ENV NODE_VERSION 8.9.4
ENV NODE_DOWNLOAD_URL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz
ENV NODE_DOWNLOAD_SHA 21fb4690e349f82d708ae766def01d7fec1b085ce1f5ab30d9bda8ee126ca8fc

RUN curl -SL "$NODE_DOWNLOAD_URL" --output nodejs.tar.gz \
    && echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
    && mkdir -p /usr/local/opt/nodejs8 \
    && tar -xzf "nodejs.tar.gz" -C /usr/local/opt/nodejs8 --strip-components=1 \
    && rm nodejs.tar.gz \
    && ln -f -s /usr/local/opt/nodejs8/bin/node /usr/local/bin/node \
    && ln -f -s /usr/local/opt/nodejs8/bin/node /usr/local/bin/nodejs
natemcmaster commented 6 years ago

One more update. We have decided not to ship a microsoft/aspnetcore-build:2.1 image. Instead, this image will migrate to be unifed with the microsoft/dotnet:sdk images, which do not contain NodeJS. Please see https://github.com/aspnet/Announcements/issues/298 for details.

oivindoh commented 6 years ago

What's the rationale behind the concern about breaking existing users though?

This would only affect users consciously choosing a later version of the image than what they're already using, or someone adventurous enough to run :latest tag (or some other tag that makes them blind to which version they're actually going to be using) in prod.

natemcmaster commented 6 years ago

Although there are ways we could do this without breaking, we don't intend to support all possible combinations of NodeJS with aspnet. Going forward, we recommend using the NodeJS image and multi stage builds, or installing NodeJS yourself on top of microsoft/dotnet:2.1-sdk.