我找到了这个网址
用于通过 https 通过 docker 托管 ASP .NET Core 映像,但找不到任何通过 https 通过 Windows 容器托管旧版 .NET 应用程序的文章。关于如何通过 https 使用 Windows 容器托管旧版 .NET 应用程序的任何想法
这与您对任何其他 Docker 化工作负载所做的操作相同,但使用 Windows 容器。
您需要:
要使用 dockerfile 构建 ASP.NET 应用程序映像,这将是最简单的示例:
# Use the official Microsoft ASP.NET image with IIS pre-installed
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8
# Set working directory in container
WORKDIR /inetpub/wwwroot
# Copy the application files to the container
COPY . .
# Expose port 80 for IIS
EXPOSE 80
# No ENTRYPOINT or CMD needed, as IIS is configured to start automatically in this base image
然后,您需要标记图像,或者让作曲家为您做这件事,将其推送到注册表,然后您就可以将其部署到某个地方了。您也可以使用 Composer 在本地运行它。
我正在使用这些图像集来托管旧版 ASP.Net 应用程序和 Microsoft SQL Server 2022:
https://github.com/david-garcia-garcia/windowscontainers
我对托管 Windows 容器的建议是 Azure Kubernetes 服务:
https://azure.microsoft.com/es-es/products/kubernetes-service
您也会在其他云提供商上找到 Windows 支持,但根据我个人的经验,最稳定的混合(Linux + Windows,因为你不能拥有仅 Windows 的 K8S 集群)集群支持在 AKS 上。