Reputation: 142
I am trying to make a dotnet runtime image for our docker clusters. I followed the following tutorial from microsoft.
https://www.microsoft.com/net/core#linuxdebian
But when I run "dotnet new console -o hwapp" I get "Did you mean to run dotnet SDK commands? Please install dotnet SDK from: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409"
Below is my docker file.
FROM "Our registry"
RUN apt-get update
RUN apt-get install curl libunwind8 gettext -y
#Installing DOTNET CORE SDK
ENV DOTNET_VERSION 1.1.1
ENV DOTNET_DOWNLOAD_URL `https://dotnetcli.blob.core.windows.net/dotnet/release/1.1.0/Binaries/$DOTNET_VERSION/dotnet-debian-x64.$DOTNET_VERSION.tar.gz`
RUN curl -SL $DOTNET_DOWNLOAD_URL --output dotnet.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
I also tried the link on Microsoft tutorial but I am still getting the same error. ANy help is appreciated in advance
Upvotes: 1
Views: 1804
Reputation: 141642
Use this URL instead in your curl
download.
https://dotnetcli.azureedge.net/dotnet/Sdk/1.0.1/dotnet-dev-debian-x64.1.0.1.tar.gz
Your script successfully installs the command line interface (CLI) but not the software development kit (SDK). Your dotnet
directory listing probably looks like this but without the sdk
directory.
$ ls /usr/share/dotnet
dotnet host LICENSE.txt sdk shared ThirdPartyNotices.txt
If you want to run dotnet new
or any of the other CLI commands, then your dotnet
directory needs to include the sdk
directory.
Both the SDK and the Runtime Linux downloads are listed here. There is a download script at the bottom that simplifies the install. The script shows two download links:
For only the shared Runtime:
$azure_feed/$azure_channel/Binaries/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz
For the SDK:
$azure_feed/Sdk/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz
The SDK download link is what we need in order to run the dotnet
commands. Note that Runtime version 1.1.1 is packaged along with SDK version 1.0.1.
Upvotes: 1