title: Azure Function in Isolated Mode: How to build a Docker container?
body: <p>I am trying to build a Function App running on <code>.net5</code> in a Docker container. As of now, I am simply trying to build the project.</p>
  <p>Here is the <code>dockerfile</code> I have so far:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
  WORKDIR /app
  
  FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
  WORKDIR /src
  COPY &quot;src/&quot; &quot;source/&quot;
  
  RUN dotnet restore &quot;source/StorageManager/StorageManager.csproj&quot;
  
  COPY . .
  WORKDIR &quot;source/StorageManager&quot;
  RUN dotnet build &quot;StorageManager.csproj&quot; -c Release -o /app/build
  </code></pre>
  <p>Here is the error I get:</p>
  <pre><code>  Determining projects to restore...
    Restored /tmp/efutopu1.pad/WorkerExtensions.csproj (in 4.21 sec).
    WorkerExtensions -&gt; /tmp/efutopu1.pad/buildout/Microsoft.Azure.Functions.Worker.Extensions.dll
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : It was not possible to find any compatible framework version [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : The framework 'Microsoft.NETCore.App', version '3.1.0' was not found. [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :   - The following frameworks were found: [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :       5.0.9 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :  [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : You can resolve the problem by installing the specified framework and/or SDK. [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :  [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : The specified framework can be found at: [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :   - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&amp;framework_version=3.1.0&amp;arch=x64&amp;rid=debian.10-x64 [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :  [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  /root/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Metadata generation failed. [/tmp/efutopu1.pad/WorkerExtensions.csproj]
  
  Build FAILED.
  </code></pre>
  <p><strong>Question</strong></p>
  <p>I do not understand what is happening. It seems like <code>Microsoft.Azure.Functions.Worker.Extensions.dll</code> package requires something more that just the <code>.net5</code> runtime but I am not sure exactly what to do. Should I use one of the following image</p>
  <p><code>https://hub.docker.com/_/microsoft-azure-functions-base</code></p>
  <p>or</p>
  <p><code>https://hub.docker.com/_/microsoft-azure-functions-dotnet-isolated</code></p>