Skip to content

Commit

Permalink
Change repo for .NET 5.0+ (#1977)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored May 14, 2020
1 parent f5838d5 commit 7cbb6f2
Showing 1 changed file with 12 additions and 10 deletions.
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

0 comments on commit 7cbb6f2

Please sign in to comment.