【发布时间】:2021-09-28 06:31:33
【问题描述】:
有一些使用独立模型的 Azure 函数,以 an out-of-process language worker 的身份运行,与 Azure Functions 运行时分开。因为 Azure Functions 运行时还不支持 .NET5。
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
我正在寻找一种如何将 .NET func 部署为 Docker 容器的方法。
func init LocalFunctionsProject --worker-runtime dotnet-isolated --docker
对于 .NET 3.1,我有 Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS installer-env
COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app && \
mkdir -p /home/site/wwwroot && \
dotnet publish *.csproj --output /home/site/wwwroot
FROM mcr.microsoft.com/azure-functions/dotnet:3.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]
如何将 .NET5 函数容器化?甚至可能吗?任何解决方法?我还没有找到解决方案。请推荐
【问题讨论】:
标签: .net azure docker .net-core azure-functions