Skip to content

Commit 8063fc5

Browse files
author
Cam Soper
authored
Update documentation to recommend using non-root app user for ASP.NET Core port configuration (#45887)
Fixes #36488
1 parent 1fe0561 commit 8063fc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/core/compatibility/containers/8.0/aspnet-port.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The change to the port number was made because of the need to provide a good usa
8282

8383
There are two ways to respond to this breaking change:
8484

85-
- (Recommended action) Explicitly set the `ASPNETCORE_HTTP_PORTS`, `ASPNETCORE_HTTPS_PORTS`, and `ASPNETCORE_URLS` environment variables to the desired port. Example: `docker run --rm -it -p 8000:80 -e ASPNETCORE_HTTP_PORTS=80 <my-app>`
85+
- (Recommended action) [In addition to using the non-root `app` user](https://devblogs.microsoft.com/dotnet/securing-containers-with-rootless/), explicitly set the `ASPNETCORE_HTTP_PORTS`, `ASPNETCORE_HTTPS_PORTS`, and `ASPNETCORE_URLS` environment variables to the desired port. Example: `docker run --rm -it -p 8000:80 -e ASPNETCORE_HTTP_PORTS=80 <my-app>`
8686
- Update existing commands and configuration that rely on the expected default port of port 80 to reference port 8080 instead. Example: `docker run --rm -it -p 8000:8080 <my-app>`
8787

8888
If your app was built using the older <xref:Microsoft.AspNetCore.WebHost.CreateDefaultBuilder?displayProperty=nameWithType> method, set `ASPNETCORE_URLS` (not `ASPNETCORE_HTTP_PORTS`). Example: `docker run --rm -it -p 8000:80 -e ASPNETCORE_URLS=http://*:80 <my-app>`.

0 commit comments

Comments
 (0)