diff --git a/Dockerfile b/Dockerfile index 75f6eb1674..2c57fdf516 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the runtime image -FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS runtime +FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine AS runtime # Add build argument for publish directory ARG PUBLISH_DIR diff --git a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Infrastructure/VersionSyncTests.cs b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Infrastructure/VersionSyncTests.cs index 2d310cb4d4..41156715a3 100644 --- a/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Infrastructure/VersionSyncTests.cs +++ b/core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Infrastructure/VersionSyncTests.cs @@ -82,7 +82,8 @@ private static string GetDotNetRuntimeVersionFromDockerfile(string dockerfilePat // Look for patterns like: // - FROM mcr.microsoft.com/dotnet/aspnet:9.0.5-bookworm-slim // - FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine - var pattern = @"FROM\s+mcr\.microsoft\.com/dotnet/aspnet:(\d+\.\d+(\.\d+)?)"; + // - FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine + var pattern = @"FROM\s+mcr\.microsoft\.com/dotnet/(?:aspnet|runtime-deps):(\d+\.\d+(\.\d+)?)"; var match = Regex.Match(dockerfileContent, pattern); if (match.Success) diff --git a/servers/Azure.Mcp.Server/CHANGELOG.md b/servers/Azure.Mcp.Server/CHANGELOG.md index 1280b18a22..7472d6652c 100644 --- a/servers/Azure.Mcp.Server/CHANGELOG.md +++ b/servers/Azure.Mcp.Server/CHANGELOG.md @@ -16,7 +16,7 @@ The Azure MCP Server updates automatically by default whenever a new release com ### Features Added -- Enabled trimmed binary for Docker and HTTP transport support for all distributions. [[#1760](https://github.com/microsoft/mcp/pull/1760)] +- Enabled trimmed binary for Docker and HTTP transport support for all distributions, reducing the Azure MCP Docker image size by ~40% (arm64: 1.21 GB to ~648 MB, amd64: 1.31 GB to ~784 MB). [[#1760](https://github.com/microsoft/mcp/pull/1760)] ### Other Changes diff --git a/servers/Azure.Mcp.Server/changelog-entries/1771625444448.yaml b/servers/Azure.Mcp.Server/changelog-entries/1771625444448.yaml new file mode 100644 index 0000000000..db664d3447 --- /dev/null +++ b/servers/Azure.Mcp.Server/changelog-entries/1771625444448.yaml @@ -0,0 +1,3 @@ +changes: + - section: "Other Changes" + description: "Switch Docker base image to runtime-deps:10.0-alpine. Since the server binary is self-contained, the full ASP.NET runtime base is unnecessary. Expected ~20-25% image size reduction (for e.g. azure-mcp images arm64: 648MB to ~482MB, amd64: 784MB to ~624MB)." \ No newline at end of file