Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions eng/dockerfile-templates/aspire-dashboard/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set aspireMajorMinor to cat(aspireVersionParts[0], ".", aspireVersionParts[1]) ^

set isAzureLinux to find(OS_VERSION, "azurelinux") >= 0 ^
set aspnetBaseTag to
cat("$REPO:", VARIABLES[cat("dotnet|8.0|product-version")], "-", OS_VERSION, "-extra", ARCH_TAG_SUFFIX) ^
set runtimeDepsBaseTag to
cat("$REPO:", VARIABLES[cat("dotnet|11.0|product-version")], "-", OS_VERSION, "-extra", ARCH_TAG_SUFFIX) ^
set osVersionBase to match(OS_VERSION, ".+(?=.*-)")[0] ^
set installerImageTag to when(isAzureLinux,
cat(VARIABLES[cat("azurelinux|", OS_VERSION_NUMBER, "|repo")], "/base/core:",
Expand All @@ -25,7 +25,7 @@
set appDir to "/app" ^
set sha to VARIABLES[join(["aspire-dashboard", "linux", ARCH_SHORT, "sha"], "|")]

}}ARG REPO=mcr.microsoft.com/dotnet/aspnet
}}ARG REPO=mcr.microsoft.com/dotnet/runtime-deps

# Installer image
FROM {{installerImageTag}} AS installer{{if isInternal:
Expand All @@ -46,11 +46,11 @@ RUN dotnet_aspire_version={{aspireVersion}} \


# Aspire Dashboard image
FROM {{aspnetBaseTag}}
FROM {{runtimeDepsBaseTag}}

WORKDIR {{appDir}}
COPY --from=installer {{appDir}} .

{{InsertTemplate("Dockerfile.envs")}}

ENTRYPOINT [ "dotnet", "{{appDir}}/Aspire.Dashboard.dll" ]
ENTRYPOINT [ "{{appDir}}/Aspire.Dashboard" ]
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13255,7 +13255,7 @@
"platforms": [
{
"buildArgs": {
"REPO": "$(Repo:aspnet)"
"REPO": "$(Repo:runtime-deps)"
},
"dockerfile": "src/aspire-dashboard/amd64",
"dockerfileTemplate": "eng/dockerfile-templates/aspire-dashboard/Dockerfile.linux",
Expand Down Expand Up @@ -13285,7 +13285,7 @@
{
"architecture": "arm64",
"buildArgs": {
"REPO": "$(Repo:aspnet)"
"REPO": "$(Repo:runtime-deps)"
},
"dockerfile": "src/aspire-dashboard/arm64v8",
"dockerfileTemplate": "eng/dockerfile-templates/aspire-dashboard/Dockerfile.linux",
Expand Down
6 changes: 3 additions & 3 deletions manifest.versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"alpine|9.0|floating-tag-version": "$(alpine|floating-tag-version)",
"alpine|8.0|floating-tag-version": "$(alpine|floating-tag-version)",

"aspire-dashboard|build-version": "13.6.0-preview.1.26471.1",
"aspire-dashboard|build-version": "13.6.0-preview.1.26479.8",
"aspire-dashboard|product-version": "13.6.0",
"aspire-dashboard|fixed-tag": "13.6.0",
"aspire-dashboard|minor-tag": "13.6",
"aspire-dashboard|major-tag": "13",
"aspire-dashboard|linux|x64|sha": "4b7f04d2e17faa6512e5c060ef885a007eef0eccd78592773670dce7dfc33c2f205359b8e414d22b6749211493aacbe421bcdb5e8dc6c7671d362598ad5e43ac",
"aspire-dashboard|linux|arm64|sha": "03ac294885faaecdaa09f84c0984da629a2370b5899aa0343ecb81737272fd7c56154107a241ea75957a4ed85b3638d99d7c89f19a81f2fd07512a828ca92ea9",
"aspire-dashboard|linux|x64|sha": "4d047a9ee97fd3a500cf8de64a74ebd77bb3012a020bc594d9a7e4830a3f165ee0f76f6999af0e949dd8fd2cade3d32b5cd98e8a8f91015dc58fff89fb0246b5",
"aspire-dashboard|linux|arm64|sha": "b6e1ffaa74b7b8c4f38f828ac700e645cdd6133e0b8239b31373f06f6f570d9edbe9551daa9a4809c8d5ee0665dd1b8c8a000f60a802eaa2585c203830c3f56d",
"aspire-dashboard|base-url|main": "$(base-url|public|preview|nightly)",
"aspire-dashboard|base-url|nightly": "$(base-url|public|preview|nightly)",

Expand Down
10 changes: 5 additions & 5 deletions src/aspire-dashboard/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG REPO=mcr.microsoft.com/dotnet/aspnet
ARG REPO=mcr.microsoft.com/dotnet/runtime-deps

# Installer image
FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS installer
Expand All @@ -9,17 +9,17 @@ RUN tdnf install -y \
&& tdnf clean all

# Retrieve Aspire Dashboard
RUN dotnet_aspire_version=13.6.0-preview.1.26471.1 \
RUN dotnet_aspire_version=13.6.0-preview.1.26479.8 \
&& curl --fail --show-error --location --output aspire_dashboard.zip https://ci.dot.net/public/aspire/$dotnet_aspire_version/aspire-dashboard-linux-x64.zip \
&& aspire_dashboard_sha512='4b7f04d2e17faa6512e5c060ef885a007eef0eccd78592773670dce7dfc33c2f205359b8e414d22b6749211493aacbe421bcdb5e8dc6c7671d362598ad5e43ac' \
&& aspire_dashboard_sha512='4d047a9ee97fd3a500cf8de64a74ebd77bb3012a020bc594d9a7e4830a3f165ee0f76f6999af0e949dd8fd2cade3d32b5cd98e8a8f91015dc58fff89fb0246b5' \
&& echo "$aspire_dashboard_sha512 aspire_dashboard.zip" | sha512sum -c - \
&& mkdir --parents /app \
&& unzip aspire_dashboard.zip -d /app \
&& rm aspire_dashboard.zip


# Aspire Dashboard image
FROM $REPO:8.0.31-azurelinux3.0-distroless-extra-amd64
FROM $REPO:11.0.0-rc.2-azurelinux3.0-distroless-extra-amd64

WORKDIR /app
COPY --from=installer /app .
Expand All @@ -33,4 +33,4 @@ ENV \
DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL=http://+:18890 \
DOTNET_DASHBOARD_MCP_ENDPOINT_URL=http://+:18891

ENTRYPOINT [ "dotnet", "/app/Aspire.Dashboard.dll" ]
ENTRYPOINT [ "/app/Aspire.Dashboard" ]
10 changes: 5 additions & 5 deletions src/aspire-dashboard/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG REPO=mcr.microsoft.com/dotnet/aspnet
ARG REPO=mcr.microsoft.com/dotnet/runtime-deps

# Installer image
FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS installer
Expand All @@ -9,17 +9,17 @@ RUN tdnf install -y \
&& tdnf clean all

# Retrieve Aspire Dashboard
RUN dotnet_aspire_version=13.6.0-preview.1.26471.1 \
RUN dotnet_aspire_version=13.6.0-preview.1.26479.8 \
&& curl --fail --show-error --location --output aspire_dashboard.zip https://ci.dot.net/public/aspire/$dotnet_aspire_version/aspire-dashboard-linux-arm64.zip \
&& aspire_dashboard_sha512='03ac294885faaecdaa09f84c0984da629a2370b5899aa0343ecb81737272fd7c56154107a241ea75957a4ed85b3638d99d7c89f19a81f2fd07512a828ca92ea9' \
&& aspire_dashboard_sha512='b6e1ffaa74b7b8c4f38f828ac700e645cdd6133e0b8239b31373f06f6f570d9edbe9551daa9a4809c8d5ee0665dd1b8c8a000f60a802eaa2585c203830c3f56d' \
&& echo "$aspire_dashboard_sha512 aspire_dashboard.zip" | sha512sum -c - \
&& mkdir --parents /app \
&& unzip aspire_dashboard.zip -d /app \
&& rm aspire_dashboard.zip


# Aspire Dashboard image
FROM $REPO:8.0.31-azurelinux3.0-distroless-extra-arm64v8
FROM $REPO:11.0.0-rc.2-azurelinux3.0-distroless-extra-arm64v8

WORKDIR /app
COPY --from=installer /app .
Expand All @@ -33,4 +33,4 @@ ENV \
DOTNET_DASHBOARD_OTLP_HTTP_ENDPOINT_URL=http://+:18890 \
DOTNET_DASHBOARD_MCP_ENDPOINT_URL=http://+:18891

ENTRYPOINT [ "dotnet", "/app/Aspire.Dashboard.dll" ]
ENTRYPOINT [ "/app/Aspire.Dashboard" ]
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,10 @@ public void VerifyEnvironmentVariables(ProductImageData imageData)
[MemberData(nameof(GetImageData))]
public void VerifyInstalledPackages(ProductImageData imageData)
{
ProductImageData expectedPackagesImageData = imageData;

// Special case for Aspire Dashboard 9.0 images:
// Aspire Dashboard 9.0 is based on .NET 8 since Azure Linux 3.0 does not yet have FedRAMP certification.
// Remove workaround once https://github.com/dotnet/dotnet-docker/issues/5375 is fixed.
if (imageData.VersionFamily == ImageVersion.V9_0)
{
expectedPackagesImageData = imageData with
{
Version = ImageVersion.V8_0
};
}

// Aspire Dashboard image is based on an "extra" image, but doesn't have the "extra" qualifier itself, so we
// need to make sure we compare the correct lists of packages.
IEnumerable<string> expectedPackages =
GetExpectedPackages(expectedPackagesImageData with { ImageVariant = DotNetImageVariant.Extra }, ImageRepo);
GetExpectedPackages(imageData with { ImageVariant = DotNetImageVariant.Extra }, ImageRepo);
IEnumerable<string> actualPackages =
GetInstalledPackages(imageData, ImageRepo, [ AppPath ]);

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions tests/Microsoft.DotNet.Docker.Tests/DockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@ public string BuildDistrolessHelper(DotNetImageRepo imageRepo, ProductImageData
Arch = imageData.Arch,
};

// Special case for Aspire Dashboard 9.0 images:
// Aspire Dashboard 9.0 is based on .NET 8 since Azure Linux 3.0 does not yet have FedRAMP certification.
// Remove workaround once https://github.com/dotnet/dotnet-docker/issues/5375 is fixed.
if (imageRepo == DotNetImageRepo.Aspire_Dashboard && imageData.VersionFamily == ImageVersion.V9_0)
{
runtimeDepsImageData = runtimeDepsImageData with
{
Version = ImageVersion.V8_0
};
}

// Make sure we don't try to get an image that we don't need before we specify that we want the distro-full
// version. The image might not be on disk. The correct, distro-full versino will be pulled in the helper
// image build.
Expand Down
6 changes: 6 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ private bool SupportsGlobalization

public string GetDockerfilePath(DotNetImageRepo imageRepo)
{
// Aspire Dashboard Dockerfiles are not organized by product version or OS.
if (imageRepo == DotNetImageRepo.Aspire_Dashboard)
{
return $"{GetRepoSrcPath(imageRepo)}/{GetArchLabel()}";
}

IEnumerable<string> pathComponents =
[
GetRepoSrcPath(imageRepo),
Expand Down
4 changes: 2 additions & 2 deletions tests/Microsoft.DotNet.Docker.Tests/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public static class TestData
{
new() {
Version = V13_6,
VersionFamily = V9_0,
VersionFamily = V11_0,
OS = OS.AzureLinux30Distroless,
OSTag = "",
OSDir = OS.AzureLinuxDistroless,
Expand All @@ -479,7 +479,7 @@ public static class TestData
},
new() {
Version = V13_6,
VersionFamily = V9_0,
VersionFamily = V11_0,
OS = OS.AzureLinux30Distroless,
OSTag = "",
OSDir = OS.AzureLinuxDistroless,
Expand Down
39 changes: 39 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/TestDataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,45 @@ public void VerifyTestData(DotNetImageRepo imageRepo)
manifestTagsByPlatform.ShouldSatisfyAllConditions(conditions);
}

// Verifies that test data maps to Dockerfile paths in the manifest. Otherwise, path-filtered test runs
// silently skip the test data. SDK and runtime-deps are excluded because their test data intentionally
// includes entries without a corresponding Dockerfile (e.g. distroless SDKs, Windows runtime-deps).
[Theory]
[InlineData(DotNetImageRepo.Runtime)]
[InlineData(DotNetImageRepo.Aspnet)]
[InlineData(DotNetImageRepo.Monitor)]
[InlineData(DotNetImageRepo.Monitor_Base)]
[InlineData(DotNetImageRepo.Aspire_Dashboard)]
[InlineData(DotNetImageRepo.Yarp)]
public void VerifyTestDataDockerfilePaths(DotNetImageRepo imageRepo)
{
string repoName = ImageData.GetRepoName(ProductImageData.GetRepoName(imageRepo));
Repo? manifestRepo = _manifest.Repos.FirstOrDefault(r => r.Name == repoName);

// If the repo is not defined in the manifest, there are no images to test, so it's safe to return early.
// This can happen when an image repo is only published from the main branch or only from the nightly branch.
if (manifestRepo is null)
{
return;
}

HashSet<string> manifestDockerfilePaths = manifestRepo.Images
.SelectMany(image => image.Platforms)
.Select(platform => platform.Dockerfile)
.ToHashSet(StringComparer.OrdinalIgnoreCase);

Action[] conditions = GetTestData(imageRepo)
.Select(productImageData => productImageData.GetDockerfilePath(imageRepo))
.Distinct()
.Select<string, Action>(dockerfilePath => () =>
manifestDockerfilePaths.ShouldContain(
dockerfilePath,
$"Expected test data Dockerfile path '{dockerfilePath}' to exist in the manifest."))
.ToArray();

manifestDockerfilePaths.ShouldSatisfyAllConditions(conditions);
}

private static IEnumerable<ProductImageData> GetTestData(DotNetImageRepo repo) =>
TestData.AllImageData.Where(p => p.SupportedImageRepos.HasFlag(repo));
}
Loading