Skip to content

Add Blazor gateway container image - #7314

Open
javiercn wants to merge 3 commits into
dotnet:nightlyfrom
javiercn:javiercn-blazor-gateway-image-plan
Open

Add Blazor gateway container image#7314
javiercn wants to merge 3 commits into
dotnet:nightlyfrom
javiercn:javiercn-blazor-gateway-image-plan

Conversation

@javiercn

Copy link
Copy Markdown
Member

Summary

  • add mcr.microsoft.com/dotnet/nightly/blazor-gateway for .NET 11 preview on Azure Linux 3.0 distroless amd64 and arm64
  • embed and SHA-512 verify Microsoft.AspNetCore.Components.Gateway.Cli, retaining only the runtime payload and third-party notices
  • add manifest/tag metadata, generated Dockerfiles and READMEs, checksum update support, and image test wiring
  • cover production liveness, client configuration, Brotli static assets, YARP proxying, and common distroless hardening checks

Stable mcr.microsoft.com/dotnet/blazor-gateway publication is intentionally deferred until .NET 11 RTM.

Validation

  • pwsh -NoProfile ./tests/run-tests.ps1 -paths '*blazor-gateway*' -TestCategories @('pre-build') (159 passed)
  • pwsh -NoProfile ./build-and-test.ps1 -mode 'Build' -paths '*blazor-gateway*'
  • pwsh -NoProfile ./tests/run-tests.ps1 -paths '*blazor-gateway*' -TestCategories @('blazor-gateway') (6 passed)
  • explicit linux/arm64 Docker build against the nightly ASP.NET base

@javiercn
javiercn marked this pull request as ready for review August 19, 2026 10:09
@javiercn
javiercn requested review from a team, joperezr and wiktork as code owners August 19, 2026 10:09
javiercn and others added 3 commits August 19, 2026 12:09
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@javiercn
javiercn force-pushed the javiercn-blazor-gateway-image-plan branch from 0449f75 to 84f49c8 Compare August 19, 2026 10:09
Comment thread manifest.versions.json
"aspnet|11.0|build-version": "11.0.0-preview.7.26381.103",
"aspnet-composite|11.0|build-version": "$(aspnet|11.0|build-version)",

"blazor-gateway|11.0|build-version": "11.0.0-preview.7.26381.103",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it always the same version as aspnet, and always ships with aspnet (from the VMR)? If so, we can just re-use the version.

Comment on lines +15 to +18
* `ClientApps` &mdash; the set of Blazor applications the gateway serves, including each application's endpoints manifest location and path prefix.
* `ReverseProxy` &mdash; standard [YARP](https://aka.ms/YarpDocumentation) reverse-proxy routes and clusters, used to proxy requests to backend APIs alongside the Blazor application(s).
* Service discovery &mdash; the gateway uses [.NET service discovery](https://learn.microsoft.com/dotnet/core/extensions/service-discovery) to resolve destination addresses for reverse-proxy clusters.
* `Gateway` &mdash; gateway-level settings.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `ClientApps` &mdash; the set of Blazor applications the gateway serves, including each application's endpoints manifest location and path prefix.
* `ReverseProxy` &mdash; standard [YARP](https://aka.ms/YarpDocumentation) reverse-proxy routes and clusters, used to proxy requests to backend APIs alongside the Blazor application(s).
* Service discovery &mdash; the gateway uses [.NET service discovery](https://learn.microsoft.com/dotnet/core/extensions/service-discovery) to resolve destination addresses for reverse-proxy clusters.
* `Gateway` &mdash; gateway-level settings.
* `ClientApps`: the set of Blazor applications the gateway serves, including each application's endpoints manifest location and path prefix.
* `ReverseProxy`: standard [YARP](https://aka.ms/YarpDocumentation) reverse-proxy routes and clusters, used to proxy requests to backend APIs alongside the Blazor application(s).
* Service discovery: the gateway uses [.NET service discovery](https://learn.microsoft.com/dotnet/core/extensions/service-discovery) to resolve destination addresses for reverse-proxy clusters.
* `Gateway`: gateway-level settings.

Comment on lines +23 to +28
docker run --rm -p 8080:8080 \
-v $(pwd)/myapp/wwwroot:/app/wwwroot:ro \
-v $(pwd)/myapp/MyApp.staticwebassets.endpoints.json:/app/myapp.endpoints.json:ro \
-e ClientApps__myapp__EndpointsManifest=/app/myapp.endpoints.json \
-e ClientApps__myapp__PathPrefix= \
{{FULL_REPO}}:{{if VARIABLES["branch"] = "nightly":11.0-preview^else:latest}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really strange way to recommend deploying an app. I don't suspect many users will actually deploy their app this way.

I think most would expect to build a Dockerfile, push it somewhere, and then deploy that.

@@ -0,0 +1,35 @@
ARG REPO=mcr.microsoft.com/dotnet/aspnet

@lbussell lbussell Aug 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gateway is supposed to be "an optimized host for deploying standalone Blazor apps". Yet it includes the whole ASP.NET Runtime. Can it be a Native AOT app instead?

I, as a user, do not understand why I should use the gateway over building my app with Yarp and app.UseStaticFiles() in my own Dockerfile. Or just nginx.

Comment on lines +13 to +15
RUN gateway_version=0.0.0 \
&& curl --fail --show-error --location --output blazor_gateway.nupkg https://globalcdn.nuget.org/packages/microsoft.aspnetcore.components.gateway.cli.$gateway_version.nupkg \
&& blazor_gateway_sha512='{sha512_placeholder}' \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When ASP.NET or Blazor gateway has security fixes, how do we get an internal pre-release version of the gateway?

Comment thread CODEOWNERS
Comment on lines +22 to +24
blazor-gateway/ @dotnet/dotnet-docker-reviewers
*blazor-gateway* @dotnet/dotnet-docker-reviewers
*Blazor-Gateway* @dotnet/dotnet-docker-reviewers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add you or your team here.


```bash
docker run --rm -p 8080:8080 \
-v $(pwd)/myapp/wwwroot:/app/wwwroot:ro \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using $(pwd) like this doesn't work on Windows/PowerShell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants