The Dockerfile generated by func init --docker-only uses other .NET version.
func init --worker-runtime dotnet-isolated creates functions project with .NET 8, then func init --docker-only creates Dockerfile that use .NET 6 images:
FROM mcr.microsoft.com/dotnet/sdk:6.0 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
# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated6.0-appservice
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated6.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]
When I do func init --worker-runtime dotnet-isolated --docker the generated Dockerfile uses .NET 8 images.
My Azure Functions Tools version is 4.0.5530.
I expected that func init --docker-only creates Dockerfile using .NET 8 images.
Because
func init --docker-onlycommands creates ain-processimage by default,func init --worker-runtime dotnet-isolatedcreates.NET 8image as onlyisolated processsupports for.NET 8.For reference check this document.
And in
in-process,.NET 6is the only version which supportsin-processmodel.link for
inprocessImages. link forinprocessImages.I created a http trigger function.
My Dockerfile:
OUTPUT: