diff --git a/aspnetcore/security/docker-https.md b/aspnetcore/security/docker-https.md index 443ccd5e44c1..c56906fcb40e 100644 --- a/aspnetcore/security/docker-https.md +++ b/aspnetcore/security/docker-https.md @@ -1,10 +1,11 @@ --- title: Hosting ASP.NET Core Images with Docker over HTTPS +ai-usage: ai-assisted author: wadepickett description: Learn how to host ASP.NET Core Images with Docker over HTTPS ms.author: wpickett ms.custom: mvc, sfi-ropc-nochange -ms.date: 09/07/2024 +ms.date: 03/03/2026 uid: security/docker-https --- # Hosting ASP.NET Core images with Docker over HTTPS @@ -61,7 +62,7 @@ Run the container image with ASP.NET Core configured for HTTPS in a command shel ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -87,7 +88,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -107,7 +108,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp ``` ***NOTE:*** `` is a placeholder for the Kestrel certificates default password. diff --git a/aspnetcore/security/includes/docker-https6.md b/aspnetcore/security/includes/docker-https6.md index fd5655a9f93f..94fc75219b84 100644 --- a/aspnetcore/security/includes/docker-https6.md +++ b/aspnetcore/security/includes/docker-https6.md @@ -48,7 +48,7 @@ Run the container image with ASP.NET Core configured for HTTPS in a command shel ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -74,7 +74,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -94,7 +94,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp ``` ***NOTE:*** `` is a placeholder for the Kestrel certificates default password.