Azure / Azure/azure-functions-docker

The official image mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0 is currently polluted with in-process WebJobs artifacts.

Open
#1,235 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
280
Forks
126
PR merge metrics
No merged PRs in 30d

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:

```


net8.0
v4
Exe
enable
enable














PreserveNewest

```

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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0 and compare its /azure-functions-host contents with the supplied Dockerfile's published output. Trace the base-image build definition in this repository; done means the isolated image starts successfully without the reported assembly error or unintended WebJobs artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.