Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change repo for .NET 5.0+ #1977

Merged
merged 2 commits into from
May 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/configureWorkspace/configureDotNetCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ import { ScaffolderContext, ScaffoldFile } from './scaffolding';
// This file handles both ASP.NET core and .NET Core Console

// .NET Core 1.0 - 2.0 images are published to Docker Hub Registry.
const LegacyAspNetCoreRuntimeImageFormat = "microsoft/aspnetcore:{0}.{1}{2}";
const LegacyAspNetCoreSdkImageFormat = "microsoft/aspnetcore-build:{0}.{1}{2}";
const LegacyDotNetCoreRuntimeImageFormat = "microsoft/dotnet:{0}.{1}-runtime{2}";
const LegacyDotNetCoreSdkImageFormat = "microsoft/dotnet:{0}.{1}-sdk{2}";
const LegacyAspNetCoreRuntimeImageFormat = "microsoft/aspnetcore:{1}.{2}{3}";
const LegacyAspNetCoreSdkImageFormat = "microsoft/aspnetcore-build:{1}.{2}{3}";
const LegacyDotNetCoreRuntimeImageFormat = "microsoft/dotnet:{1}.{2}-runtime{3}";
const LegacyDotNetCoreSdkImageFormat = "microsoft/dotnet:{1}.{2}-sdk{3}";

// .NET Core 2.1+ images are now published to Microsoft Container Registry (MCR).
// .NET Core 5.0+ images do not have "core/" in the name.
// https://hub.docker.com/_/microsoft-dotnet-core-runtime/
const DotNetCoreRuntimeImageFormat = "mcr.microsoft.com/dotnet/core/runtime:{0}.{1}{2}";
const DotNetCoreRuntimeImageFormat = "mcr.microsoft.com/dotnet/{0}runtime:{1}.{2}{3}";
// https://hub.docker.com/_/microsoft-dotnet-core-aspnet/
const AspNetCoreRuntimeImageFormat = "mcr.microsoft.com/dotnet/core/aspnet:{0}.{1}{2}";
const AspNetCoreRuntimeImageFormat = "mcr.microsoft.com/dotnet/{0}aspnet:{1}.{2}{3}";
// https://hub.docker.com/_/microsoft-dotnet-core-sdk/
const DotNetCoreSdkImageFormat = "mcr.microsoft.com/dotnet/core/sdk:{0}.{1}{2}";
const DotNetCoreSdkImageFormat = "mcr.microsoft.com/dotnet/{0}sdk:{1}.{2}{3}";

function GetWindowsImageTag(): string {
// The host OS version needs to match the version of .NET core images being created
Expand All @@ -69,9 +70,10 @@ function GetWindowsImageTag(): string {

function formatVersion(format: string, version: string, tagForWindowsVersion: string): string {
let asSemVer = new semver.SemVer(version);
return format.replace('{0}', asSemVer.major.toString())
.replace('{1}', asSemVer.minor.toString())
.replace('{2}', tagForWindowsVersion);
return format.replace('{0}', asSemVer.major >= 5 ? '' : 'core/')
.replace('{1}', asSemVer.major.toString())
.replace('{2}', asSemVer.minor.toString())
.replace('{3}', tagForWindowsVersion);
}

// #region ASP.NET Core templates
Expand Down