question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`func init --docker` generates old version of Dockerfile for C# isolated

See original GitHub issue

Customers are reporting (and I’ve also verified) that func init --worker-runtime dotnet-isolated --docker is generating what seems to be an older Dockerfile:

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS installer-env

# Build requires 3.1 SDK
COPY --from=mcr.microsoft.com/dotnet/core/sdk:3.1 /usr/share/dotnet /usr/share/dotnet

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:3.0-dotnet-isolated5.0-appservice
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:3.0-dotnet-isolated5.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]

The in-process version uses the correct base image, but both still reference mcr.microsoft.com/dotnet/core/sdk:3.1 which I’m pretty sure is no longer supported.

This bug is affecting all customers using func.exe to generate Dockerfiles for their C# isolated worker process function apps.

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
khkh-mscommented, Jun 5, 2023

Please install the latest version which should be 4.0.5198.

0reactions
ggailey777commented, Jun 5, 2023

Verified that 4.0.5.5198 fixes the issue. Thanks @khkh-ms I’ll update the container docs to note the func.exe version requirement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Isolated function using docker works in debug but not as a ...
Hi there, I am using .net7 rc2 preview and azure functions in isolated mode. When I debug them as a console app or...
Read more >
Dockerfile reference
Dockerfile reference link Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains ......
Read more >
Deprecated Engine Features
Docker API v1.42 and up now ignores this option when set. Older versions of the API continue to accept the option, but depending...
Read more >
Create a base image - Docker Build
Most Dockerfiles start from a parent image. If you need to completely control the contents of your image, you might need to create...
Read more >
docker build
The docker build command builds Docker images from a Dockerfile and a "context". A build's context is the set of files located in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found