diff --git a/tests/Microsoft.DotNet.Docker.Tests/ImageData.cs b/tests/Microsoft.DotNet.Docker.Tests/ImageData.cs index 8bc193ef8f..9dedc1e7a9 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/ImageData.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/ImageData.cs @@ -20,8 +20,8 @@ public abstract record ImageData public Arch Arch { get; set; } public bool IsArm => Arch == Arch.Arm || Arch == Arch.Arm64; - public string OS { get; set; } - public bool IsDistroless => OS.Contains(Tests.OS.DistrolessSuffix) || OS.Contains(Tests.OS.ChiseledSuffix); + public OSInfo OS { get; set; } + public bool IsDistroless => OS.IsDistroless; public virtual int DefaultPort => 8080; public virtual int? NonRootUID => IsWindows ? null : 1654; @@ -66,7 +66,7 @@ public string Platform _ => throw new NotImplementedException() }; - public bool IsWindows => OS.StartsWith(Tests.OS.NanoServer) || OS.StartsWith(Tests.OS.ServerCore); + public bool IsWindows => OS.IsWindows; public string Rid { @@ -87,7 +87,7 @@ public string Rid Arch.Amd64 => "x64", _ => throw new NotImplementedException() }; - string modifier = OS.StartsWith(Tests.OS.Alpine) ? "musl-" : ""; + string modifier = OS.Family == OSFamily.Alpine ? "musl-" : ""; rid = $"linux-{modifier}{arch}"; } diff --git a/tests/Microsoft.DotNet.Docker.Tests/OS.cs b/tests/Microsoft.DotNet.Docker.Tests/OS.cs index 41eb07f3e4..8390e66862 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/OS.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/OS.cs @@ -2,54 +2,49 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -namespace Microsoft.DotNet.Docker.Tests +#nullable enable + +namespace Microsoft.DotNet.Docker.Tests; + +internal static class OS { - public static class OS - { - // Alpine - public const string Alpine = "alpine"; - public const string Alpine321 = $"{Alpine}3.21"; - public const string Alpine322 = $"{Alpine}3.22"; - public const string Alpine323 = $"{Alpine}3.23"; - - // AzureLinux - public const string AzureLinux = "azurelinux"; - public const string AzureLinuxDistroless = $"{AzureLinux}-distroless"; - public const string AzureLinux30 = $"{AzureLinux}3.0"; - public const string AzureLinux30Distroless = $"{AzureLinux30}-distroless"; - - // Debian - public const string Bookworm = "bookworm"; - public const string BookwormSlim = $"{Bookworm}{SlimSuffix}"; - - // Mariner - public const string Mariner = "cbl-mariner"; - public const string MarinerDistroless = $"{Mariner}-distroless"; - public const string Mariner20 = $"{Mariner}2.0"; - public const string Mariner20Distroless = $"{Mariner20}-distroless"; - - // Ubuntu - public const string Jammy = "jammy"; - public const string JammyChiseled = $"{Jammy}{ChiseledSuffix}"; - public const string Noble = "noble"; - public const string NobleChiseled = $"{Noble}{ChiseledSuffix}"; - public const string Resolute = "resolute"; - public const string ResoluteChiseled = $"{Resolute}{ChiseledSuffix}"; - public const string UbuntuChiseled = $"ubuntu{ChiseledSuffix}"; - - // Windows - public const string NanoServer = "nanoserver"; - public const string NanoServer1809 = $"{NanoServer}-1809"; - public const string NanoServerLtsc2022 = $"{NanoServer}-ltsc2022"; - public const string NanoServerLtsc2025 = $"{NanoServer}-ltsc2025"; - public const string ServerCore = "windowsservercore"; - public const string ServerCoreLtsc2019 = $"{ServerCore}-ltsc2019"; - public const string ServerCoreLtsc2022 = $"{ServerCore}-ltsc2022"; - public const string ServerCoreLtsc2025 = $"{ServerCore}-ltsc2025"; - - // Helpers - public const string DistrolessSuffix = "-distroless"; - public const string ChiseledSuffix = "-chiseled"; - public const string SlimSuffix = "-slim"; - } + // String constants for special tagging cases (appliance images) + public const string Alpine = "alpine"; + public const string AzureLinuxDistroless = "azurelinux-distroless"; + public const string MarinerDistroless = "cbl-mariner-distroless"; + public const string UbuntuChiseled = "ubuntu-chiseled"; + + // Alpine + public static OSInfo AlpineFloating { get; } = new(OSType.Linux, OSFamily.Alpine, ""); + public static OSInfo Alpine322 { get; } = AlpineFloating with { Version = "3.22" }; + public static OSInfo Alpine323 { get; } = AlpineFloating with { Version = "3.23" }; + + // Azure Linux + public static OSInfo AzureLinux30 { get; } = new(OSType.Linux, OSFamily.AzureLinux, "3.0"); + public static OSInfo AzureLinux30Distroless { get; } = AzureLinux30 with { IsDistroless = true }; + + // Debian + public static OSInfo BookwormSlim { get; } = new(OSType.Linux, OSFamily.Debian, "12"); + + // Mariner (CBL-Mariner) + public static OSInfo Mariner20 { get; } = new(OSType.Linux, OSFamily.Mariner, "2.0"); + public static OSInfo Mariner20Distroless { get; } = Mariner20 with { IsDistroless = true }; + + // Ubuntu + public static OSInfo Jammy { get; } = new(OSType.Linux, OSFamily.Ubuntu, "22.04"); + public static OSInfo JammyChiseled { get; } = Jammy with { IsDistroless = true }; + public static OSInfo Noble { get; } = new(OSType.Linux, OSFamily.Ubuntu, "24.04"); + public static OSInfo NobleChiseled { get; } = Noble with { IsDistroless = true }; + public static OSInfo Resolute { get; } = new(OSType.Linux, OSFamily.Ubuntu, "26.04"); + public static OSInfo ResoluteChiseled { get; } = Resolute with { IsDistroless = true }; + + // Windows - Nano Server + public static OSInfo NanoServer1809 { get; } = new(OSType.Windows, OSFamily.NanoServer, "1809"); + public static OSInfo NanoServerLtsc2022 { get; } = NanoServer1809 with { Version = "LTSC 2022" }; + public static OSInfo NanoServerLtsc2025 { get; } = NanoServer1809 with { Version = "LTSC 2025" }; + + // Windows - Server Core + public static OSInfo ServerCoreLtsc2019 { get; } = new(OSType.Windows, OSFamily.WindowsServerCore, "LTSC 2019"); + public static OSInfo ServerCoreLtsc2022 { get; } = ServerCoreLtsc2019 with { Version = "LTSC 2022" }; + public static OSInfo ServerCoreLtsc2025 { get; } = ServerCoreLtsc2019 with { Version = "LTSC 2025" }; } diff --git a/tests/Microsoft.DotNet.Docker.Tests/OSInfo.cs b/tests/Microsoft.DotNet.Docker.Tests/OSInfo.cs new file mode 100644 index 0000000000..c35e80d294 --- /dev/null +++ b/tests/Microsoft.DotNet.Docker.Tests/OSInfo.cs @@ -0,0 +1,134 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +#nullable enable + +namespace Microsoft.DotNet.Docker.Tests; + +/// +/// Represents the type of operating system. +/// +public enum OSType +{ + Linux, + Windows +} + +/// +/// Represents the family or distribution of an operating system. +/// +public enum OSFamily +{ + Alpine, + AzureLinux, + Debian, + Mariner, + Ubuntu, + NanoServer, + WindowsServerCore +} + +/// +/// Operating system used in .NET container images. +/// +/// The type of operating system (Linux or Windows). +/// The family or distribution of the operating system. +/// +/// The version of the operating system. Do not use codenames here. Use the +/// version exactly as it appears in the OS's own documentation. Examples: +/// "3.23" for Alpine, "26.04" for Ubuntu, "LTSC 2025" for Windows Server Core. +/// +/// Whether the OS is distroless. +public sealed record OSInfo( + OSType Type, + OSFamily Family, + string Version, + bool IsDistroless = false) +{ + /// + /// Gets the tag name for this OS, used in Docker image tags. + /// + public string TagName + { + get + { + static string GetCodename(OSFamily family, string version) => (family, version) switch + { + (OSFamily.Debian, "12") => "bookworm", + (OSFamily.Ubuntu, "22.04") => "jammy", + (OSFamily.Ubuntu, "24.04") => "noble", + (OSFamily.Ubuntu, "26.04") => "resolute", + _ => throw new InvalidOperationException($"Unknown {family} version: {version}") + }; + + string baseTag = Family switch + { + OSFamily.Alpine => string.IsNullOrEmpty(Version) ? "alpine" : $"alpine{Version}", + OSFamily.AzureLinux => $"azurelinux{Version}", + OSFamily.Debian => $"{GetCodename(Family, Version)}-slim", + OSFamily.Mariner => $"cbl-mariner{Version}", + OSFamily.Ubuntu => GetCodename(Family, Version), + OSFamily.NanoServer => $"nanoserver-{Version.ToLowerInvariant().Replace(" ", "")}", + OSFamily.WindowsServerCore => $"windowsservercore-{Version.ToLowerInvariant().Replace(" ", "")}", + _ => throw new InvalidOperationException($"Unknown OS family: {Family}") + }; + + return (Family, IsDistroless) switch + { + (OSFamily.Ubuntu, true) => $"{baseTag}-chiseled", + (_, true) => $"{baseTag}-distroless", + _ => baseTag + }; + } + } + + /// + /// Gets the display name for this OS, combining family and version. + /// + public string DisplayName + { + get + { + string familyName = Family switch + { + OSFamily.Alpine => "Alpine", + OSFamily.AzureLinux => "Azure Linux", + OSFamily.Debian => "Debian", + OSFamily.Mariner => "CBL-Mariner", + OSFamily.Ubuntu => "Ubuntu", + OSFamily.NanoServer => "Nano Server", + OSFamily.WindowsServerCore => "Windows Server Core", + _ => Family.ToString() + }; + + return string.IsNullOrEmpty(Version) ? familyName : $"{familyName} {Version}"; + } + } + + /// + /// Gets a value indicating whether this OS is Windows-based. + /// + public bool IsWindows => Type == OSType.Windows; + + /// + /// Checks if the TagName contains the specified value. + /// Provides backward compatibility with string-based OS checks. + /// + public bool Contains(string value) => TagName.Contains(value); + + /// + /// Checks if the TagName starts with the specified value. + /// Provides backward compatibility with string-based OS checks. + /// + public bool StartsWith(string value) => TagName.StartsWith(value); + + /// + /// Implicit conversion to string for backward compatibility with existing code. + /// + public static implicit operator string(OSInfo os) => os.TagName; + + public override string ToString() => TagName; +} diff --git a/tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs b/tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs index 4549a4570e..bd28a99e00 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs @@ -11,17 +11,17 @@ namespace Microsoft.DotNet.Docker.Tests { public record ProductImageData : ImageData { - private string _sdkOS; + private OSInfo _sdkOS; private string _osTag; private string _osDir; private ImageVersion? _versionFamily; - public bool HasCustomSdk => _sdkOS != null; + public bool HasCustomSdk => _sdkOS is not null; public bool GlobalizationInvariantMode => !SupportsGlobalization; // PowerShell does not support Arm-based Alpine - public bool SupportsPowerShell => !(OS.Contains("alpine") && IsArm); + public bool SupportsPowerShell => !(OS.Family == OSFamily.Alpine && IsArm); /// /// Indicates whether the SDK version of the image supports `dnx` and @@ -29,7 +29,7 @@ public record ProductImageData : ImageData /// public bool SupportsDnx => VersionFamily != ImageVersion.V8_0 && VersionFamily != ImageVersion.V9_0; - public string SdkOS + public OSInfo SdkOS { get => HasCustomSdk ? _sdkOS : OS; init => _sdkOS = value; @@ -70,7 +70,7 @@ private bool SupportsGlobalization { get { - bool isSizeFocusedImage = IsDistroless || OS.Contains(Tests.OS.Alpine); + bool isSizeFocusedImage = IsDistroless || OS.Family == OSFamily.Alpine; return ImageVariant.HasFlag(DotNetImageVariant.Extra) || !isSizeFocusedImage; } } diff --git a/tests/Microsoft.DotNet.Docker.Tests/ProductImageTests.cs b/tests/Microsoft.DotNet.Docker.Tests/ProductImageTests.cs index 79c670a02e..25181422ef 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/ProductImageTests.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/ProductImageTests.cs @@ -109,7 +109,7 @@ protected void VerifyCommonDefaultUser(ProductImageData imageData) string expectedUser; if (imageData.IsDistroless && ImageRepo != DotNetImageRepo.SDK) { - if (imageData.OS.StartsWith(OS.Mariner)) + if (imageData.OS.Family == OSFamily.Mariner) { expectedUser = "app"; } @@ -120,7 +120,7 @@ protected void VerifyCommonDefaultUser(ProductImageData imageData) } // For Windows, only Nano Server defines a user, which seems wrong. // I've logged https://dev.azure.com/microsoft/OS/_workitems/edit/40146885 for this. - else if (imageData.OS.StartsWith(OS.NanoServer)) + else if (imageData.OS.Family == OSFamily.NanoServer) { expectedUser = "ContainerUser"; } @@ -256,7 +256,7 @@ internal static IEnumerable GetExpectedPackages(ProductImageData imageDa private static IEnumerable GetDistrolessBasePackages(ProductImageData imageData) => imageData switch { - { OS: string os } when os.Contains(OS.AzureLinux) => new[] + { OS.Family: OSFamily.AzureLinux } => new[] { "SymCrypt", "SymCrypt-OpenSSL", @@ -266,7 +266,7 @@ internal static IEnumerable GetExpectedPackages(ProductImageData imageDa "prebuilt-ca-certificates", "tzdata" }, - { OS: string os } when os.Contains(OS.Mariner) => new[] + { OS.Family: OSFamily.Mariner } => new[] { "distroless-packages-minimal", "filesystem", @@ -274,7 +274,7 @@ internal static IEnumerable GetExpectedPackages(ProductImageData imageDa "prebuilt-ca-certificates", "tzdata" }, - { OS: string os } when os.Contains(OS.ChiseledSuffix) => new[] + { OS.Family: OSFamily.Ubuntu } => new[] { "base-files" }, @@ -284,7 +284,7 @@ internal static IEnumerable GetExpectedPackages(ProductImageData imageDa private static IEnumerable GetRuntimeDepsPackages(ProductImageData imageData) { IEnumerable packages = imageData switch { - { OS: string os } when os.Contains(OS.Mariner) || os.Contains(OS.AzureLinux) => + { OS.Family: OSFamily.Mariner or OSFamily.AzureLinux } => [ "glibc", "libgcc", @@ -292,7 +292,7 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image "openssl-libs", "libstdc++" ], - { OS: string os } when os.Contains(OS.Jammy) => + { OS: var os } when os == OS.JammyChiseled => [ "ca-certificates", "gcc-12-base", @@ -302,7 +302,7 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image "openssl", "libstdc++6" ], - { OS: OS.NobleChiseled } => + { OS: var os } when os == OS.NobleChiseled => [ "ca-certificates", "gcc-14-base", @@ -313,7 +313,7 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image "openssl", "libstdc++6" ], - { OS: OS.ResoluteChiseled, Arch: Arch.Amd64 } => + { OS: var os, Arch: Arch.Amd64 } when os == OS.ResoluteChiseled => [ "ca-certificates", "gcc-14-base", @@ -328,7 +328,7 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image "openssl-provider-legacy", "zlib" ], - { OS: OS.ResoluteChiseled } => + { OS: var os } when os == OS.ResoluteChiseled => [ "ca-certificates", "gcc-14-base", @@ -340,7 +340,7 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image "openssl", "zlib" ], - { OS: string os } when os.Contains(OS.Noble) => + { OS: var os } when os == OS.Noble => [ "ca-certificates", "gcc-14-base", @@ -350,7 +350,7 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image "openssl", "libstdc++6" ], - { OS: string os } when os.Contains(OS.Resolute) => + { OS: var os } when os == OS.Resolute => [ "ca-certificates", "gcc-15-base", @@ -360,14 +360,14 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image "openssl", "libstdc++6" ], - { OS: string os } when os.Contains(OS.Alpine) => + { OS.Family: OSFamily.Alpine } => [ "ca-certificates-bundle", "libgcc", "libssl3", "libstdc++" ], - { OS: OS.BookwormSlim } => + { OS: var os } when os == OS.BookwormSlim => [ "ca-certificates", "libc6", @@ -386,7 +386,7 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image // - https://packages.ubuntu.com/plucky/amd64/libssl3t64 // - https://packages.ubuntu.com/resolute/amd64/libssl3t64 // - https://github.com/canonical/chisel-releases/blob/ubuntu-26.04/slices/libssl3t64.yaml - if (imageData.Version.Major == 8 || imageData.OS.Contains(OS.Resolute)) + if (imageData.Version.Major == 8 || imageData.OS.Version == "26.04") { packages = [..packages, GetZLibPackage(imageData.OS)]; } @@ -394,37 +394,37 @@ private static IEnumerable GetRuntimeDepsPackages(ProductImageData image return packages; } - private static string GetZLibPackage(string os) + private static string GetZLibPackage(OSInfo os) { - string[] unversionedZLibOSes = [OS.Alpine, OS.AzureLinux, OS.Mariner]; - return unversionedZLibOSes.Where(os.Contains).Any() ? "zlib" : "zlib1g"; + OSFamily[] unversionedZLibOSFamilies = [OSFamily.Alpine, OSFamily.AzureLinux, OSFamily.Mariner]; + return unversionedZLibOSFamilies.Contains(os.Family) ? "zlib" : "zlib1g"; } private static IEnumerable GetExtraPackages(ProductImageData imageData) => imageData switch { - { IsDistroless: true, OS: string os } when os.Contains(OS.Mariner) || os.Contains(OS.AzureLinux) => new[] + { IsDistroless: true, OS.Family: OSFamily.Mariner or OSFamily.AzureLinux } => new[] { "icu", "tzdata" }, - { OS: OS.NobleChiseled } => new[] + { OS: var os } when os == OS.NobleChiseled => new[] { "libicu74", "tzdata-legacy", "tzdata" }, - { OS: OS.ResoluteChiseled } => new[] + { OS: var os } when os == OS.ResoluteChiseled => new[] { "icu", "libicu76", "tzdata" }, - { OS: OS.JammyChiseled } => new[] + { OS: var os } when os == OS.JammyChiseled => new[] { "libicu70", "tzdata" }, - { OS: string os } when os.Contains(OS.Alpine) => new[] + { OS.Family: OSFamily.Alpine } => new[] { "icu-data-full", "icu-libs", diff --git a/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs b/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs index 280e33f6a2..4903389b32 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs @@ -132,7 +132,7 @@ public void VerifyDistrolessOSReleaseInfo(ProductImageData imageData) [MemberData(nameof(GetImageData))] public void VerifyChiselManifest(ProductImageData imageData) { - if (!imageData.OS.Contains(OS.ChiseledSuffix)) + if (!(imageData.OS.Family == OSFamily.Ubuntu && imageData.IsDistroless)) { OutputHelper.WriteLine("Test is only relevant to Ubuntu Chiseled images"); return; diff --git a/tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs b/tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs index 02a2a68dd4..1b386433dc 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs @@ -70,7 +70,7 @@ public async void VerifyBlazorWasmScenario(ProductImageData imageData) } // `wasm-tools` is not supported on Alpine for .NET < 9 due to https://github.com/dotnet/sdk/issues/32327 - if (imageData.OS.StartsWith(OS.Alpine) && imageData.Version.Major == 8) + if (imageData.OS.Family == OSFamily.Alpine && imageData.Version.Major == 8) { useWasmTools = false; } @@ -122,7 +122,7 @@ public void VerifyEnvironmentVariables(ProductImageData imageData) ..GetCommonEnvironmentVariables(), ]; - if (imageData.SdkOS.StartsWith(OS.Alpine)) + if (imageData.SdkOS.Family == OSFamily.Alpine) { variables.Add(new EnvironmentVariableInfo("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "false")); } @@ -346,7 +346,7 @@ private string GetSdkUrl(ProductImageData imageData) : GetSdkVersionFileLabel(sdkBuildVersion, imageData.VersionString); string osType = DockerHelper.IsLinuxContainerModeEnabled ? "linux" : "win"; - if (imageData.SdkOS.StartsWith(OS.Alpine)) + if (imageData.SdkOS.Family == OSFamily.Alpine) { osType += "-musl"; } diff --git a/tests/Microsoft.DotNet.Docker.Tests/TestData.cs b/tests/Microsoft.DotNet.Docker.Tests/TestData.cs index 60cb79f81d..16a4ac7bc8 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/TestData.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/TestData.cs @@ -400,9 +400,9 @@ public static class TestData private static readonly SampleImageData[] s_linuxSampleTestData = { - new SampleImageData { OS = OS.Alpine, Arch = Arch.Amd64, DockerfileSuffix = "alpine", IsPublished = true }, - new SampleImageData { OS = OS.Alpine, Arch = Arch.Arm, DockerfileSuffix = "alpine", IsPublished = true }, - new SampleImageData { OS = OS.Alpine, Arch = Arch.Arm64, DockerfileSuffix = "alpine", IsPublished = true }, + new SampleImageData { OS = OS.AlpineFloating, Arch = Arch.Amd64, DockerfileSuffix = "alpine", IsPublished = true }, + new SampleImageData { OS = OS.AlpineFloating, Arch = Arch.Arm, DockerfileSuffix = "alpine", IsPublished = true }, + new SampleImageData { OS = OS.AlpineFloating, Arch = Arch.Arm64, DockerfileSuffix = "alpine", IsPublished = true }, new SampleImageData { OS = OS.JammyChiseled, Arch = Arch.Arm, DockerfileSuffix = "chiseled", IsPublished = true }, new SampleImageData { OS = OS.JammyChiseled, Arch = Arch.Arm64, DockerfileSuffix = "chiseled", IsPublished = true }, new SampleImageData { OS = OS.JammyChiseled, Arch = Arch.Amd64, DockerfileSuffix = "chiseled", IsPublished = true }, @@ -410,10 +410,10 @@ public static class TestData new SampleImageData { OS = OS.BookwormSlim, Arch = Arch.Amd64 }, new SampleImageData { OS = OS.BookwormSlim, Arch = Arch.Arm }, new SampleImageData { OS = OS.BookwormSlim, Arch = Arch.Arm64 }, - new SampleImageData { OS = OS.Alpine, Arch = Arch.Arm64, DockerfileSuffix = "alpine" }, - new SampleImageData { OS = OS.Alpine, Arch = Arch.Amd64, DockerfileSuffix = "alpine" }, - new SampleImageData { OS = OS.Alpine, Arch = Arch.Arm64, DockerfileSuffix = "alpine-icu" }, - new SampleImageData { OS = OS.Alpine, Arch = Arch.Amd64, DockerfileSuffix = "alpine-icu" }, + new SampleImageData { OS = OS.AlpineFloating, Arch = Arch.Arm64, DockerfileSuffix = "alpine" }, + new SampleImageData { OS = OS.AlpineFloating, Arch = Arch.Amd64, DockerfileSuffix = "alpine" }, + new SampleImageData { OS = OS.AlpineFloating, Arch = Arch.Arm64, DockerfileSuffix = "alpine-icu" }, + new SampleImageData { OS = OS.AlpineFloating, Arch = Arch.Amd64, DockerfileSuffix = "alpine-icu" }, new SampleImageData { OS = OS.BookwormSlim, Arch = Arch.Arm, DockerfileSuffix = "debian" }, new SampleImageData { OS = OS.BookwormSlim, Arch = Arch.Arm64, DockerfileSuffix = "debian" }, new SampleImageData { OS = OS.BookwormSlim, Arch = Arch.Amd64, DockerfileSuffix = "debian" }, diff --git a/tests/Microsoft.DotNet.Docker.Tests/TestScenarios/NlsScenario.cs b/tests/Microsoft.DotNet.Docker.Tests/TestScenarios/NlsScenario.cs index 853caf3371..a67f3f82a4 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/TestScenarios/NlsScenario.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/TestScenarios/NlsScenario.cs @@ -35,7 +35,7 @@ public NlsScenario( } // ICU is not supported on Nano Server - private bool IsIcuSupported => _imageData.OS.Contains(OS.ServerCore); + private bool IsIcuSupported => _imageData.OS.Family == OSFamily.WindowsServerCore; public Task ExecuteAsync() {