Skip to content
This repository was archived by the owner on May 31, 2019. It is now read-only.

Commit 69be597

Browse files
authored
Add README to 2.1 folder explaining where the 2.1 images have gone (#408)
1 parent 7cb9a65 commit 69be597

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

2.1/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
HTTP 301 Moved Permanently
2+
--------------------------
3+
4+
**Where are the 2.1 aspnet-docker images?**
5+
6+
In 2.1\*, the ASP.NET Core Docker images have migrated to https://github.com/dotnet/dotnet-docker.
7+
8+
_\*Note: ASP.NET Core 2.1 is still in preview._
9+
10+
**How can I upgrade from 1.x/2.0 to 2.1?**
11+
12+
You can upgrade to 2.1 and by changing the repository name in the `FROM` line in your Dockerfile using this mapping:
13+
14+
Current | Upgrade
15+
--------|--------------
16+
`microsoft/aspnetcore:1.0`<br>`microsoft/aspnetcore:1.1`<br>`microsoft/aspnetcore:2.0` | `microsoft/dotnet:2.1-aspnetcore-runtime`
17+
`microsoft/aspnetcore-build:1.0`<br>`microsoft/aspnetcore-build:1.1`<br>`microsoft/aspnetcore-build:2.0` | `microsoft/dotnet:2.1-sdk`
18+
19+
**I was using NodeJS in `microsoft/aspnetcore-build`, but this is missing from `microsoft/dotnet:2.1-sdk`. What should I do?**
20+
21+
You can either install NodeJS by adding a few lines of code to your Dockerfile that download and extract NodeJS,
22+
or you can use the multi-stage feature of Docker and the official NodeJS images.
23+
24+
Sample code to install NodeJS on your own:
25+
26+
```Dockerfile
27+
# set up node
28+
ENV NODE_VERSION 8.9.4
29+
ENV NODE_DOWNLOAD_SHA 21fb4690e349f82d708ae766def01d7fec1b085ce1f5ab30d9bda8ee126ca8fc
30+
RUN curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz \
31+
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
32+
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
33+
&& rm nodejs.tar.gz \
34+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
35+
```
36+
37+
Sample code to use multi-arch build
38+
```Dockerfile
39+
FROM node:8 AS node-builder
40+
WORKDIR /src
41+
COPY . .
42+
RUN npm run webpack
43+
44+
FROM microsoft/dotnet:2.1-sdk AS dotnet-builder
45+
WORKDIR /app
46+
COPY --from=node-builder /src/dist/*.js ./dist
47+
```

0 commit comments

Comments
 (0)