-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
When I try to run an isolated docker, the container crashes, since it seems to be poluted
docker % docker run --rm -it mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0 ls -l /azure-functions-host | grep -i webjobs
Unable to find image 'mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0' locally
4-dotnet-isolated8.0: Pulling from azure-functions/dotnet-isolated
d107e437f729: Already exists
c8dc41235996: Already exists
7c2c457f0889: Already exists
a37ef0701ba8: Already exists
e0b0ecf09218: Already exists
a85b88f0cfff: Already exists
578d61833fb1: Already exists
76b94a98d2b8: Already exists
4ae45320b9a1: Already exists
da7884dff6d2: Already exists
b1242459acc1: Already exists
2ca5673985df: Already exists
c65a965cb8f1: Already exists
409ecca27b94: Already exists
8ec5e490e519: Already exists
2731913c617a: Already exists
Digest: sha256:9cd018c36604776c5c6aaf16f2161b423c1278143c82514cf0d7ef88285b2dd6
Status: Downloaded newer image for mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0
-rw-r--r-- 1 root root 61440 Sep 10 04:52 Microsoft.Azure.WebJobs.Extensions.Http.dll
-rw-r--r-- 1 root root 16384 Sep 10 04:52 Microsoft.Azure.WebJobs.Extensions.Timers.Storage.dll
-rw-r--r-- 1 root root 91136 Sep 10 04:52 Microsoft.Azure.WebJobs.Extensions.dll
-rw-r--r-- 1 root root 50688 Sep 10 04:52 Microsoft.Azure.WebJobs.Host.Storage.dll
-rw-r--r-- 1 root root 711168 Sep 10 04:52 Microsoft.Azure.WebJobs.Host.dll
-rw-r--r-- 1 root root 85504 Sep 10 04:52 Microsoft.Azure.WebJobs.Logging.ApplicationInsights.dll
-rw-r--r-- 1 root root 15872 Sep 10 04:52 Microsoft.Azure.WebJobs.Rpc.Core.dll
-rw-r--r-- 1 root root 19456 Sep 10 04:52 Microsoft.Azure.WebJobs.Script.Abstractions.dll
-rw-r--r-- 1 root root 403968 Sep 10 04:52 Microsoft.Azure.WebJobs.Script.Grpc.dll
-rwxr-xr-x 1 root root 72568 Sep 10 04:50 Microsoft.Azure.WebJobs.Script.WebHost
-rw-r--r-- 1 root root 271324 Sep 10 04:52 Microsoft.Azure.WebJobs.Script.WebHost.deps.json
-rw-r--r-- 1 root root 1083904 Sep 10 04:52 Microsoft.Azure.WebJobs.Script.WebHost.dll
-rw-r--r-- 1 root root 141427200 Sep 10 04:52 Microsoft.Azure.WebJobs.Script.WebHost.r2r.dll
-rw-r--r-- 1 root root 105919608 Sep 10 04:52 Microsoft.Azure.WebJobs.Script.WebHost.r2r.ni.r2rmap
-rw-r--r-- 1 root root 685 Sep 10 04:51 Microsoft.Azure.WebJobs.Script.WebHost.runtimeconfig.json
-rw-r--r-- 1 root root 1288192 Sep 10 04:52 Microsoft.Azure.WebJobs.Script.dll
-rw-r--r-- 1 root root 11616 Sep 10 04:49 Microsoft.Azure.WebJobs.Script.dll.config
-rw-r--r-- 1 root root 19968 Sep 10 04:52 Microsoft.Azure.WebJobs.dll
docker %
If I understand correct, these files cause the issue.
When I start the docker, it immediately crashes and This is the log
2025-09-12 12:11:21 WEBSITES_INCLUDE_CLOUD_CERTS is not set to true.
2025-09-12 12:11:21 Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Hosting.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
2025-09-12 12:11:21
2025-09-12 12:11:21 File name: 'Microsoft.AspNetCore.Hosting.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
2025-09-12 12:11:21 at Microsoft.Azure.WebJobs.Script.WebHost.Program.CreateWebHostBuilder
2025-09-12 12:11:21 at Microsoft.Azure.WebJobs.Script.WebHost.Program.BuildWebHost in //src/WebJobs.Script.WebHost/Program.cs:line 36
2025-09-12 12:11:21 at Microsoft.Azure.WebJobs.Script.WebHost.Program.Main(String[] args) in //src/WebJobs.Script.WebHost/Program.cs:line 28
2025-09-12 12:11:21 /opt/startup/start_nonappservice.sh: line 4: 9 Aborted /azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost
This is my proj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Data.Tables" Version="12.11.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.8" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.15.0" OutputItemType="Analyzer" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="5.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
my DockerFile:
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY *.csproj ./
COPY Functions ./Functions
COPY Helpers ./Helpers
COPY Models ./Models
COPY Services ./Services
COPY Program.cs ./
COPY host.json ./
# (repeat for any other needed files/folders)
RUN dotnet publish -c Release -o /app/publish && ls -l /app/publish
# Runtime stage
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0
WORKDIR /azure-functions-host
COPY --from=build /app/publish/. .
COPY worker.config.json ./
COPY extensions.json ./
RUN ls -l /azure-functions-host
RUN ls -l /app/publish && find /app/publish | grep WebJobs || true
EXPOSE 8080
ENV AzureWebJobsScriptRoot=/azure-functions-host
Metadata
Metadata
Assignees
Labels
No labels