Skip to content

Commit

Permalink
Remove -preview in Dockerfile Scaffolding for .NET 8 RC release (#4042
Browse files Browse the repository at this point in the history
)

* added new image convention for .NET 8 RC release

* added constant
  • Loading branch information
alexyaang authored Sep 13, 2023
1 parent 24b465d commit 888c504
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/scaffolding/wizard/netCore/NetCoreGatherInformationStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const netSdkImage = 'mcr.microsoft.com/dotnet/sdk';

const cSharpConfigId = 'csharp';
const cSharpPromptSetting = 'suppressBuildAssetsNotification';
const NetCorePreviewVersion = 9;

export class NetCoreGatherInformationStep extends GatherInformationStep<NetCoreScaffoldingWizardContext> {
private targetFramework: string;
Expand Down Expand Up @@ -53,16 +54,14 @@ export class NetCoreGatherInformationStep extends GatherInformationStep<NetCoreS
wizardContext.netCoreRuntimeBaseImage = wizardContext.platform === '.NET: ASP.NET Core' ? `${aspNetBaseImage}:${netCoreVersion.major}.${netCoreVersion.minor}` : `${consoleNetBaseImage}:${netCoreVersion.major}.${netCoreVersion.minor}`;
wizardContext.netCoreSdkBaseImage = `${netSdkImage}:${netCoreVersion.major}.${netCoreVersion.minor}`;

if (netCoreVersion.major === 8) {
if (wizardContext.netCorePlatformOS === 'Windows') {
// append '-preview-nanoserver-ltsc2022' for windows base images for .NET 8's new naming convention
wizardContext.netCoreRuntimeBaseImage = `${wizardContext.netCoreRuntimeBaseImage}-preview-nanoserver-1809`;
wizardContext.netCoreSdkBaseImage = `${wizardContext.netCoreSdkBaseImage}-preview-nanoserver-1809`;
} else {
// append '-preview' for everything else
wizardContext.netCoreRuntimeBaseImage = `${wizardContext.netCoreRuntimeBaseImage}-preview`;
wizardContext.netCoreSdkBaseImage = `${wizardContext.netCoreSdkBaseImage}-preview`;
}
if (netCoreVersion.major >= NetCorePreviewVersion) {
wizardContext.netCoreRuntimeBaseImage = `${wizardContext.netCoreRuntimeBaseImage}-preview`;
wizardContext.netCoreSdkBaseImage = `${wizardContext.netCoreSdkBaseImage}-preview`;
}
// append '-nanoserver-ltsc2022' for windows base images for .NET 8+'s new naming convention
if (wizardContext.netCorePlatformOS === 'Windows') {
wizardContext.netCoreRuntimeBaseImage = `${wizardContext.netCoreRuntimeBaseImage}-nanoserver-1809`;
wizardContext.netCoreSdkBaseImage = `${wizardContext.netCoreSdkBaseImage}-nanoserver-1809`;
}

// change default user to adapt to Debian 12
Expand Down

0 comments on commit 888c504

Please sign in to comment.